Model II – Subroutines

OK, it’s time to list and figure out the Subroutine structure of Model II.

I’m doing this on a new download onto the Devuan chip using userid pi.
This is so that the structure is not tied to my userid.
This is so that (if I’m lucky) I can offer clones of the chip to any Pi user. We’ll see…

First, we just find all instances of SUBROUTINE in the FORTRAN code. Then we’ll make a very reduced list (one line per subroutine defintion) Don’t let this large block of text scare you. I break it down to smaller bits below. This is just the raw data capture from the source code.

As I remove the comments down below, this lets you have a reverence to see a bit of the comments near the active code.

pi@raspberrypi:/Climate/GCM/modelII/trunk $  grep SUB *.f
DB11pdC9.f:      SUBROUTINE DIAGA (U,V,T,P,Q)
DB11pdC9.f:      SUBROUTINE DIAGB (U,V,T,P,Q)
DB11pdC9.f:c  ** ZERO OUT SUBSURFACE VERTICAL WINDS
DB11pdC9.f:      SUBROUTINE DIAGJ
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES AREA WEIGHTED STATISTICS OF
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAGJK
DB11pdC9.f:      SUBROUTINE DIAGJK
DB11pdC9.f:      SUBROUTINE JKMAP (NT,PM,AX,SCALE,SCALEJ,SCALEK,KMAX,JWT,J1)
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAGJL
DB11pdC9.f:     2'SUBGRID SCALE TEMPERATURE DEVIATION (HUNDREDTHS OF DEGREES KEL.)'
DB11pdC9.f:      SUBROUTINE DIAGJL
DB11pdC9.f:c  ** SUBGRID SCALE TEMPERATURE DEVIATION
DB11pdC9.f:      SUBROUTINE JLMAP (NT,PL,AX,SCALE,SCALEJ,SCALEL,LMAX,JWT,J1)
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES LAYER BY LATITUDE TABLES ON THE LINE
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAGIL
DB11pdC9.f:      SUBROUTINE DIAGIL
DB11pdC9.f:      SUBROUTINE ILMAP (NT,PL,AX,SCALE,SCALEL,LMAX,JWT,ISHIFT)
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAG7
DB11pdC9.f:      SUBROUTINE DIAG7A
DB11pdC9.f:c  ** THIS SUBROUTINE ACCUMULATES A TIME SEQUENCE FOR SELECTED
DB11pdC9.f:      SUBROUTINE MEM (SERIES,ITM,MMAX,NUAMAX,NUBMAX,POWER,FPE,VAR,PNU)
DB11pdC9.f:      SUBROUTINE DIAGIJ
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES LATITUDE BY LONGITUDE MAPS OF
DB11pdC9.f:      SUBROUTINE IJMAP (NT,ARRAY,BYIACC)
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES NUMERICAL LATITUDE BY LONGITUDE MAPS OF
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAG9
DB11pdC9.f:      SUBROUTINE DIAG9A (M)
DB11pdC9.f:      SUBROUTINE DIAG5A (M5,NDT)
DB11pdC9.f:c  ** TITLES FOR SUBROUTINE DIAG6
DB11pdC9.f:      SUBROUTINE DIAG6
DB11pdC9.f:c  ** THIS SUBROUTINE PRINTS THE DIURNAL CYCLE OF SOME QUANTITIES
DB11pdC9.f:      SUBROUTINE DIAG4A
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES A TIME HISTORY OF ENERGIES
DB11pdC9.f:      SUBROUTINE DIAGKS
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES A SUMMARY OF KEY NUMBERS CALCULATED IN
DB11pdC9.f:c  ** OTHER DIAGNOSTIC SUBROUTINES
DB11pdC9.f:      SUBROUTINE DIAG10(IPFLAG)
DB11pdC9.f:c  ** THIS SUBROUTINE SAVES THE INSTANTANEOUS SEA LEVEL PRESSURES
DB11pdC9.f:      SUBROUTINE SIJMAP
DB11pdC9.f:c  ** THIS SUBROUTINE PRODUCES LATITUDE BY LONGITUDE MAPS OF:
FFT36macDBL.f:      SUBROUTINE FRTR0 (KM)
FFT36macDBL.f:  901 FORMAT ('0THIS FOURT SUBROUTINE NOT SUITED FOR KM = ',I8)
FFT36macDBL.f:      SUBROUTINE FRTR (F)
FFT36macDBL.f:c  ** THIS SUBROUTINE PERFORMS A FOURIER ANALYSIS ON THE ONE DIMENSIONAL
FFT36macDBL.f:      SUBROUTINE GETAN (F,G)
FORCINGSjalC9.f:      SUBROUTINE SOLARFORCING
FORCINGSjalC9.f:      SUBROUTINE DATAREFYEAR(XGAS,YEAR,NGAS)
FORCINGSjalC9.f:      SUBROUTINE DATAFILETREND(XGAS,YEAR,NGAS)
Mjal2cpdC9.f:      SUBROUTINE GEOM                                                    401.
Mjal2cpdC9.f:      SUBROUTINE GEOM_8x10
Mjal2cpdC9.f:      SUBROUTINE INPUT                                                   501.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE SETS THE PARAMETERS IN THE C ARRAY, READS IN THE   503.   
Mjal2cpdC9.f:C        IN SUBROUTINE SURFACE THE MORE PRECISE VALUE 99.66 IS USED      850.3  
Mjal2cpdC9.f:     *  ' RESUBMIT JOB WITH AN EARLIER TAUE CARD'                        882.2
Mjal2cpdC9.f:      SUBROUTINE DYNAM
Mjal2cpdC9.f:      SUBROUTINE AFLUX (U,V,P)                                          1001.
Mjal2cpdC9.f:C**** THIS SUBROUTINE CALCULATES THE HORIZONTAL AIR MASS FLUXES         1003.
Mjal2cpdC9.f:      SUBROUTINE ADVECM (P,PA,DT1)                                      1501.
Mjal2cpdC9.f:C**** THIS SUBROUTINE CALCULATES UPDATED COLUMN PRESSURES AS            1503.
Mjal2cpdC9.f:      SUBROUTINE ADVECV (PA,UT,VT,PB,U,V,P,DT1)                         2001.
Mjal2cpdC9.f:C**** THIS SUBROUTINE ADVECTS MOMENTUM (INCLUDING THE CORIOLIS FORCE)   2003.
Mjal2cpdC9.f:      SUBROUTINE PGF (UT,VT,PB,U,V,T,P,DT1)                             2501.
Mjal2cpdC9.f:C**** THIS SUBROUTINE ADDS TO MOMENTUM THE TENDENCIES DETERMINED BY     2503.
Mjal2cpdC9.f:      SUBROUTINE ADVECT (PA,TT,PB,T,DT1)                                3001.
Mjal2cpdC9.f:C**** THIS SUBROUTINE ADVECTS POTENTIAL TEMPERATURE                     3003.
Mjal2cpdC9.f:      SUBROUTINE ADVECQ (PA,QT,PB,Q,DT1)                                3501.
Mjal2cpdC9.f:C**** THIS SUBROUTINE ADVECTS HUMIDITY AS DETERMINED BY DT1 AND THE     3503.
Mjal2cpdC9.f:      SUBROUTINE AVRX (PU)                                              1801.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE SMOOTHES THE ZONAL MASS FLUX AND GEOPOTENTIAL     1803.   
Mjal2cpdC9.f:      SUBROUTINE SDRAG                                                  7001.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE PUTS A DRAG ON THE WINDS ON THE TOP LAYER OF      7003.   
Mjal2cpdC9.f:      SUBROUTINE FILTER                                                 7501.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE PERFORMS AN 8-TH ORDER SHAPIRO FILTER ON          7503.   
Mjal2cpdC9.f:      SUBROUTINE SHAP1D (NORDER)                                        7801.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE SMOOTHES THE ARRAY X IN THE ZONAL DIRECTION       7803.   
Mjal2cpdC9.f:      SUBROUTINE DAILY                                                  8001.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE PERFORMS THOSE FUNCTIONS OF THE PROGRAM WHICH     8003.   
Mjal2cpdC9.f:      SUBROUTINE CHECKT (N)                                             9001.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE CHECKS WHETHER THE TEMPERATURES ARE REASONABLE    9003.   
Pjal0C9.f:      SUBROUTINE CONDSE                                                 2001.   
Pjal0C9.f:C**** THIS SUBROUTINE MIXES AIR CAUSED BY MOIST CONVECTION, AND         2003.   
Pjal0C9.f:C**** SET UP VERTICAL ARRAYS, OMITTING THE J AND I SUBSCRIPTS           2170.   
Pjal0C9.f:C**** SUBSIDENCE AND MIXING                                             2306.   
Pjal0C9.f:      SUBROUTINE PRECIP                                                 3001.   
Pjal0C9.f:C**** THIS SUBROUTINE USES THE PRECIPITATION TO CALCULATE THE GROUND    3003.   
Pjal0C9.f:      SUBROUTINE RADIA0                                                 3501.   
Pjal0C9.f:C**** THIS SUBROUTINE SETS THE RADIATION CONTROL PARAMETERS AND         3503.   
Pjal0C9.f:      SUBROUTINE RADIA                                                  4001.   
Pjal0C9.f:C**** THIS SUBROUTINES ADDS THE RADIATION HEATING TO THE TEMPERATURES   4003.   
Pjal0C9.f:      SUBROUTINE SURFCE                                                 4801.   
Pjal0C9.f:C**** THIS SUBROUTINE CALCULATES THE SURFACE FLUXES WHICH INCLUDE       4803.   
Pjal0C9.f:      SUBROUTINE GROUND                                                 6001.   
Pjal0C9.f:C**** THIS SUBROUTINE USES THE SURFACE FLUXES TO PREDICT IN TIME THE    6003.   
Pjal0C9.f:C**** TG1 IS AT FREEZING POINT, SUBTRACT WATER THAT DIFFUSES OUT OF G1  6481.   
Pjal0C9.f:      SUBROUTINE DRYCNV                                                 6801.   
Pjal0C9.f:C**** THIS SUBROUTINE MIXES AIR CAUSED BY DRY CONVECTION.  SINCE DRY    6803.   
Pjal0C9.f:C**** CONVECTION IN THE BOUNDARY LAYER IS DONE IN SUBROUTINE SURFCE,    6804.   
Pjal0C9.f:      SUBROUTINE ORBIT (OBLIQ,ECCN,OMEGT,DAY,SDIST,SIND,COSD,LAMBDA)    8201.   
Pjal0C9.f:      SUBROUTINE OSTRUC                                                 8501.   
Pjal0C9.f:C**** THIS SUBROUTINE RESTRUCTURES THE OCEAN TEMPERATURE PROFILE        8503.   
Pjal0C9.f:C**** THE SUBROUTINE ALSO MELTS ICE WHEN TGO > 0 (C).                   8506.   
Pjal0C9.f:      SUBROUTINE ODIFS                                                  8601.   
Pjal0C9.f:C**** THIS SUBROUTINE CALCULATES THE ANNUAL OCEAN TEMPERATURE AT THE    8603.   
Pjal0C9.f:C**** TEMPERATURE, CALLS SUBROUTINE DIFFUS, AND REDUCES THE UPPER       8605.   
Pjal0C9.f:      SUBROUTINE DIFFUS (IM,JM,DT,ALPHA,ED,Z12O,PWATER,R)               8701.   
Pjal0C9.f:C**** THIS SUBROUTINE CALCULATES THE VERTICAL MIXING OF A TRACER, R,    8703.   
R83ZAmacDBL.f:      SUBROUTINE RCOMP1(NFTTTR,NFTTSR,NFTFOR)                              1.   
R83ZAmacDBL.f:      SUBROUTINE SETALB                                                  179.   
R83ZAmacDBL.f:      SUBROUTINE SETGAS                                                  587.   
R83ZAmacDBL.f:      SUBROUTINE SETAER                                                 1011.   
R83ZAmacDBL.f:      SUBROUTINE TAUGAS                                                 1236.   
R83ZAmacDBL.f:      SUBROUTINE THERML                                                 1515.   
R83ZAmacDBL.f:      SUBROUTINE SOLAR                                                  1958.   
R83ZAmacDBL.f:      SUBROUTINE SETAO2(O2CMA,NL)                                       2609.   
R83ZAmacDBL.f:      SUBROUTINE SETO3D                                                 2877.   
R83ZAmacDBL.f:      SUBROUTINE PHDATM(P,H,D,T,O,Q,S,OCM,WCM,NPHD,NATM)                4238.   
R83ZAmacDBL.f:C                  NATM=4  GIVES ATMOSPHERE DATA FOR  SUBARCTIC SUMMER  4252.   
R83ZAmacDBL.f:C                  NATM=5  GIVES ATMOSPHERE DATA FOR  SUBARCTIC WINTER  4253.   
R83ZAmacDBL.f:C4444 SUBARCTIC SUMMER        MCCLATCHY (1972) ATMOSPHERE DATA VS HEIGHT4422.   
R83ZAmacDBL.f:C5555 SUBARCTIC WINTER        MCCLATCHY (1972) ATMOSPHERE DATA VS HEIGHT4453.   
R83ZAmacDBL.f:      SUBROUTINE WRITER(INDEX,KPAGE)                                    4813.   
R83ZAmacDBL.f:      SUBROUTINE SOLARZ(NG,KWRITE)                                      5668.   
R83ZAmacDBL.f:      SUBROUTINE GAUSST(NG,X1,X2,XP,WT)                                 5782.   
R83ZAmacDBL.f:      SUBROUTINE SETATM                                                 5833.   
R83ZAmacDBL.f:      SUBROUTINE SETFOR(NFTFOR)                                         6108.   
R83ZAmacDBL.f:      SUBROUTINE HGAER1(XMU,TAU,G,GG)                                   6301.   
R83ZAmacDBL.f:      SUBROUTINE HGCLD1(XMU,TAU,G,GG)                                   6820.   
R83ZAmacDBL.f:      SUBROUTINE ADDVOL                                                 7472.   
RFRCmacDBL.f:      SUBROUTINE FORSET(TREF,KTREND,KWRITE)                                1.   
RFRCmacDBL.f:      SUBROUTINE ATREND(XGAS,YEAR,NGAS)                                 1001.   
RFRCmacDBL.f:      SUBROUTINE BTREND(XGAS,YEAR,NGAS)                                 2001.   
RFRCmacDBL.f:      SUBROUTINE CTREND(XGAS,YEAR,NGAS)                                 3001.   
RFRCmacDBL.f:      SUBROUTINE DTREND(XGAS,YEAR,NGAS)                                 4001.   
RFRCmacDBL.f:      SUBROUTINE YTREND(XGAS,YEAR,NGAS)                                 5001.   
RFRCmacDBL.f:      SUBROUTINE ZTREND(XGAS,YEAR,NGAS)                                 6001.   
RFRCmacDBL.f:      SUBROUTINE DTDX1D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7101.   
RFRCmacDBL.f:      SUBROUTINE DXDT1D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7201.   
RFRCmacDBL.f:      SUBROUTINE DXDT3D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7301.   
RFRCmacDBL.f:      SUBROUTINE DTDX3D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7401.   
RFRCmacDBL.f:      SUBROUTINE DTXCFY(DTSUM,DTNR,XNOW,XREF,NGAS)                      7501.   
RFRCmacDBL.f:      SUBROUTINE DTXCFZ(DTSUM,DTNR,XNOW,XREF,NGAS)                      7601.   
RFRCmacDBL.f:      SUBROUTINE VMSSET(KDTAUA,KWRITE)                                  8001.   
setpath.f:      SUBROUTINE SETPATH
UTILmacDBL.f:      SUBROUTINE CLOCKS(IHSC)
UTILmacDBL.f:      SUBROUTINE DREAD (IUNIT,AIN,LENGTH,AOUT)
UTILmacDBL.f:      SUBROUTINE MREAD (IUNIT,M,NSKIP,AIN,LENGTH,AOUT)
UTILmacDBL.f:      SUBROUTINE READT (IUNIT,NSKIP,AIN,LENGTH,AOUT,IPOS)
UTILmacDBL.f:      SUBROUTINE TIMER (MNOW,MINC,MSUM)
UTILmacDBL.f:c  **         MINC (.01 S) = TIME SINCE LAST CALL TO SUBROUTINE TIMER
UTILwinDBL.f:      SUBROUTINE CLOCKS(IHSC)
UTILwinDBL.f:      SUBROUTINE DREAD (IUNIT,AIN,LENGTH,AOUT)
UTILwinDBL.f:      SUBROUTINE MREAD (IUNIT,M,NSKIP,AIN,LENGTH,AOUT)
UTILwinDBL.f:      SUBROUTINE READT (IUNIT,NSKIP,AIN,LENGTH,AOUT,IPOS)
UTILwinDBL.f:      SUBROUTINE TIMER (MNOW,MINC,MSUM)
UTILwinDBL.f:c  **         MINC (.01 S) = TIME SINCE LAST CALL TO SUBROUTINE TIMER

Breaking It Down by Program

OK, now to reduce it to “one per definition” (or ‘weed out the comments and crap’)

DB11pdC9.f:      SUBROUTINE DIAGA (U,V,T,P,Q)
DB11pdC9.f:      SUBROUTINE DIAGB (U,V,T,P,Q)
DB11pdC9.f:      SUBROUTINE DIAGJ
DB11pdC9.f:      SUBROUTINE DIAGJK
DB11pdC9.f:      SUBROUTINE JKMAP (NT,PM,AX,SCALE,SCALEJ,SCALEK,KMAX,JWT,J1)
DB11pdC9.f:      SUBROUTINE DIAGJL
DB11pdC9.f:      SUBROUTINE JLMAP (NT,PL,AX,SCALE,SCALEJ,SCALEL,LMAX,JWT,J1)
DB11pdC9.f:      SUBROUTINE DIAGIL
DB11pdC9.f:      SUBROUTINE ILMAP (NT,PL,AX,SCALE,SCALEL,LMAX,JWT,ISHIFT)
DB11pdC9.f:      SUBROUTINE DIAG7A
DB11pdC9.f:      SUBROUTINE MEM (SERIES,ITM,MMAX,NUAMAX,NUBMAX,POWER,FPE,VAR,PNU)
DB11pdC9.f:      SUBROUTINE DIAGIJ

I note in passing that we already have confusingly similar names in DIAGJK DIAGJL DIAGIL DIAGIJ … That’s just very human hostile coding practice…

DB11pdC9.f:      SUBROUTINE IJMAP (NT,ARRAY,BYIACC)
DB11pdC9.f:      SUBROUTINE DIAG9A (M)
DB11pdC9.f:      SUBROUTINE DIAG5A (M5,NDT)
DB11pdC9.f:      SUBROUTINE DIAG6
DB11pdC9.f:      SUBROUTINE DIAG4A
DB11pdC9.f:      SUBROUTINE DIAGKS
DB11pdC9.f:      SUBROUTINE DIAG10(IPFLAG)
DB11pdC9.f:      SUBROUTINE SIJMAP

So at this point, we have 20 subroutines devoted to “Diagnostics”. I suspect these are not very important at this stage of the analysis, but we’ll see when we get more into it. The diagnostic part is not high on my investigation rank of what to look at next…

FFT36macDBL.f:      SUBROUTINE FRTR (F)
FFT36macDBL.f:      SUBROUTINE GETAN (F,G)

Two subroutines in the Fast Fourier Transform module. OK, might be worth a look to assure it’s done right and efficiently, but most likely it is and it is fine. Wonder why they did their own Get Tangent function, though…

FORCINGSjalC9.f:      SUBROUTINE SOLARFORCING
FORCINGSjalC9.f:      SUBROUTINE DATAREFYEAR(XGAS,YEAR,NGAS)
FORCINGSjalC9.f:      SUBROUTINE DATAFILETREND(XGAS,YEAR,NGAS)

Gee, “FORCINGS” that have a (IMHO too simple) Solar component of seasonal and orbital shift of TSI / latitude and then two that look at GAS as “FORCINGS”… Worth looking into the SOLARFOCING routine to see what makes it tick, to confirm my suspicions. (Or refute them…)

This next block seems to do the bulk of the world modeling, with air flux and geometry and such.

Mjal2cpdC9.f:      SUBROUTINE GEOM                                                    401.
Mjal2cpdC9.f:      SUBROUTINE GEOM_8x10
Mjal2cpdC9.f:      SUBROUTINE INPUT                                                   501.   
Mjal2cpdC9.f:      SUBROUTINE DYNAM
Mjal2cpdC9.f:      SUBROUTINE AFLUX (U,V,P)                                          1001.
Mjal2cpdC9.f:      SUBROUTINE ADVECM (P,PA,DT1)                                      1501.
Mjal2cpdC9.f:      SUBROUTINE ADVECV (PA,UT,VT,PB,U,V,P,DT1)                         2001.
Mjal2cpdC9.f:      SUBROUTINE PGF (UT,VT,PB,U,V,T,P,DT1)                             2501.
Mjal2cpdC9.f:      SUBROUTINE ADVECT (PA,TT,PB,T,DT1)                                3001.
Mjal2cpdC9.f:      SUBROUTINE ADVECQ (PA,QT,PB,Q,DT1)                                3501.

This next one has the comment that it covers the advection of humidity. I need to look inside it to see if it covers vertical movement as well (though advection ought not…). IMHO it is likely one of the ones with “something wrong” in how moisture is handled.

Mjal2cpdC9.f:C**** THIS SUBROUTINE ADVECTS HUMIDITY AS DETERMINED BY DT1 AND THE     3503.
Mjal2cpdC9.f:      SUBROUTINE AVRX (PU)                                              1801.     
Mjal2cpdC9.f:      SUBROUTINE SDRAG                                                  7001.  

As I recall it, the Hansen paper said they needed to add this drag to get things to stabilize. An interesting “Dig Here!” would be the justification for the particular value used. Near as I could tell from the paper, it was a tuning point…

 
Mjal2cpdC9.f:C**** THIS SUBROUTINE PUTS A DRAG ON THE WINDS ON THE TOP LAYER OF      7003.

Continuing…

Mjal2cpdC9.f:      SUBROUTINE FILTER                                                 7501.     
Mjal2cpdC9.f:      SUBROUTINE SHAP1D (NORDER)                                        7801.   
Mjal2cpdC9.f:      SUBROUTINE DAILY                                                  8001.     
Mjal2cpdC9.f:      SUBROUTINE CHECKT (N)                                             9001.   
Mjal2cpdC9.f:C**** THIS SUBROUTINE CHECKS WHETHER THE TEMPERATURES ARE REASONABLE    9003.  

Another interesting question: What is done when temperatures have gotten “unreasonable”? Is this just a lid crammed on instabilities in the model? What does it do, and why? With what justification other than bringing stability to an out of control runaway process?

OK, 16 subroutines in Mjal* to look at. Not too bad for the global driver part.

This next one (Pjal*) looks to have the physics in it.

 
Pjal0C9.f:      SUBROUTINE CONDSE                                                 2001.   
Pjal0C9.f:C**** THIS SUBROUTINE MIXES AIR CAUSED BY MOIST CONVECTION, AND         2003.   

Another place where one ought to look for how humidity ends up at altitude in the model, but not in reality…

 
Pjal0C9.f:      SUBROUTINE PRECIP                                                 3001.   
Pjal0C9.f:      SUBROUTINE RADIA0                                                 3501.     
Pjal0C9.f:      SUBROUTINE RADIA                                                  4001.   
Pjal0C9.f:      SUBROUTINE SURFCE                                                 4801.   
Pjal0C9.f:      SUBROUTINE GROUND                                                 6001.   
Pjal0C9.f:      SUBROUTINE DRYCNV                                                 6801.   
Pjal0C9.f:C**** THIS SUBROUTINE MIXES AIR CAUSED BY DRY CONVECTION.  SINCE DRY    6803.   
Pjal0C9.f:C**** CONVECTION IN THE BOUNDARY LAYER IS DONE IN SUBROUTINE SURFCE,    6804.   

More clue on where to look for the wrong moisture at altitude part. Dry Convection likely needs to be higher, and mixing less? Or maybe just the precipitation routine needs to wring out more water…

Pjal0C9.f:      SUBROUTINE ORBIT (OBLIQ,ECCN,OMEGT,DAY,SDIST,SIND,COSD,LAMBDA)    8201.   
Pjal0C9.f:      SUBROUTINE OSTRUC                                                 8501.   
Pjal0C9.f:      SUBROUTINE ODIFS                                                  8601.   
Pjal0C9.f:      SUBROUTINE DIFFUS (IM,JM,DT,ALPHA,ED,Z12O,PWATER,R)               8701.   

I make that 11 physics routines to work through. IMHO, it is likely where things need the most help. Then again, the next block does a lot of the actual stirring of the pot.

R83ZAmacDBL.f:      SUBROUTINE RCOMP1(NFTTTR,NFTTSR,NFTFOR)                              1.   
R83ZAmacDBL.f:      SUBROUTINE SETALB                                                  179.   
R83ZAmacDBL.f:      SUBROUTINE SETGAS                                                  587.   
R83ZAmacDBL.f:      SUBROUTINE SETAER                                                 1011.   
R83ZAmacDBL.f:      SUBROUTINE TAUGAS                                                 1236.   
R83ZAmacDBL.f:      SUBROUTINE THERML                                                 1515.   
R83ZAmacDBL.f:      SUBROUTINE SOLAR                                                  1958.   
R83ZAmacDBL.f:      SUBROUTINE SETAO2(O2CMA,NL)                                       2609.   
R83ZAmacDBL.f:      SUBROUTINE SETO3D                                                 2877.   
R83ZAmacDBL.f:      SUBROUTINE PHDATM(P,H,D,T,O,Q,S,OCM,WCM,NPHD,NATM)                4238.   
R83ZAmacDBL.f:      SUBROUTINE WRITER(INDEX,KPAGE)                                    4813.   
R83ZAmacDBL.f:      SUBROUTINE SOLARZ(NG,KWRITE)                                      5668.   
R83ZAmacDBL.f:      SUBROUTINE GAUSST(NG,X1,X2,XP,WT)                                 5782.   
R83ZAmacDBL.f:      SUBROUTINE SETATM                                                 5833.   
R83ZAmacDBL.f:      SUBROUTINE SETFOR(NFTFOR)                                         6108.   
R83ZAmacDBL.f:      SUBROUTINE HGAER1(XMU,TAU,G,GG)                                   6301.   
R83ZAmacDBL.f:      SUBROUTINE HGCLD1(XMU,TAU,G,GG)                                   6820.   
R83ZAmacDBL.f:      SUBROUTINE ADDVOL                                                 7472.   

Looks like 18 that do the setup of various batches of input and such. Ought to look through it to see if this is where the input files get read in too.

RFRCmacDBL.f:      SUBROUTINE FORSET(TREF,KTREND,KWRITE)                                1.   
RFRCmacDBL.f:      SUBROUTINE ATREND(XGAS,YEAR,NGAS)                                 1001.   
RFRCmacDBL.f:      SUBROUTINE BTREND(XGAS,YEAR,NGAS)                                 2001.   
RFRCmacDBL.f:      SUBROUTINE CTREND(XGAS,YEAR,NGAS)                                 3001.   
RFRCmacDBL.f:      SUBROUTINE DTREND(XGAS,YEAR,NGAS)                                 4001.   
RFRCmacDBL.f:      SUBROUTINE YTREND(XGAS,YEAR,NGAS)                                 5001.   
RFRCmacDBL.f:      SUBROUTINE ZTREND(XGAS,YEAR,NGAS)                                 6001.   
RFRCmacDBL.f:      SUBROUTINE DTDX1D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7101.   
RFRCmacDBL.f:      SUBROUTINE DXDT1D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7201.   
RFRCmacDBL.f:      SUBROUTINE DXDT3D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7301.   
RFRCmacDBL.f:      SUBROUTINE DTDX3D(XNOW,XREF,XDT0,SDT0,KFOR,NFOR)                  7401.   
RFRCmacDBL.f:      SUBROUTINE DTXCFY(DTSUM,DTNR,XNOW,XREF,NGAS)                      7501.   
RFRCmacDBL.f:      SUBROUTINE DTXCFZ(DTSUM,DTNR,XNOW,XREF,NGAS)                      7601.   
RFRCmacDBL.f:      SUBROUTINE VMSSET(KDTAUA,KWRITE)                                  8001.   

Looks to me like 14 subroutines devoted to Radiative Forcing calculations. (RFR?) Gee, wonder where the ocean cycle forcing and the cosmic ray forcing and the solar UV vs IR forcing and the… where are they handled?…

setpath.f:      SUBROUTINE SETPATH
UTILmacDBL.f:      SUBROUTINE CLOCKS(IHSC)
UTILmacDBL.f:      SUBROUTINE DREAD (IUNIT,AIN,LENGTH,AOUT)
UTILmacDBL.f:      SUBROUTINE MREAD (IUNIT,M,NSKIP,AIN,LENGTH,AOUT)
UTILmacDBL.f:      SUBROUTINE READT (IUNIT,NSKIP,AIN,LENGTH,AOUT,IPOS)
UTILmacDBL.f:      SUBROUTINE TIMER (MNOW,MINC,MSUM)
UTILwinDBL.f:      SUBROUTINE CLOCKS(IHSC)
UTILwinDBL.f:      SUBROUTINE DREAD (IUNIT,AIN,LENGTH,AOUT)
UTILwinDBL.f:      SUBROUTINE MREAD (IUNIT,M,NSKIP,AIN,LENGTH,AOUT)
UTILwinDBL.f:      SUBROUTINE READT (IUNIT,NSKIP,AIN,LENGTH,AOUT,IPOS)
UTILwinDBL.f:      SUBROUTINE TIMER (MNOW,MINC,MSUM)

Then 11 that do utility functions. Not likely to be ‘an issue’, so lower priority to look over.

So what’s that total make?

Diagnostic:  20
FFT:          2
FORCINGS      3
Model Outer  16
Physics      11
Setting Up   18
Radiative    14
Utilities    11

I make that a total of 95 subroutines. OK, that’s going to take some time.

I’m going to start with disposing of the 2 FFT and 3 FORCINGS, just because they are small.
Then look at the 11 physics as I think they are likely the meat of it.

I suspect the Diagnostics are for postmortem of runs and will leave them for last (or a cursory examination may make it ‘never’ if they don’t contribute anything to the actual model runs.)

That will be followed by the 16 “Model Outer” as I seems to do a lot of interesting stuff in terms of how it coordinates the physics and such. (And has a lot of modification comments so a high ‘dick with’ factor implying it may be where tuning happened…)

IFF, after that, there’s still too much mystery, I’ll move on into the Setting Up 18 (or if I need to look at it to get the thing to run…) and the 14 Radiative (though I think they have the radiative physics right, just messed up the actual physical physics and left out important processes…)

I doubt “Utilities” has much interest, but I’ll poke my nose into it long enough to assure that.

In Conclusion

So that’s the “big lumps” on the block diagram of Subroutines.

I still need to search through the code for functions and such. Then make sure I understand the outer driving cycle of the MAIN body (when I find it ;-)

Still, as a first cruise through, I think this is likely coming together nicely. We have some math and science parts (FFT and Radiative and Physics) that can be vetted (both for correctness and completion). We have an apparent Setting Up part and some Utilities and Diagnostics that likly have more to do with operations than execution of science, Then we have a FORCINGS that provides an understanding of what the modeler decided are the only relevant FORCINGS. Finally, the model MAIN driving the process of connecting all the bits and the outer loops. (Time and Geography…)

Doesn’t look to big, or too hard, just a bit long. Even at “one subroutine a day”, we’re talking 95 days. With 20 work days a month, that’s 5 months. And that’s just for the subroutines…

But every journey begins with just one step, and this is about step 3 on MODEL II, so we’re well on our way.

Anyone wishing to download, unpack, and take a whack at one of these, feel free (Hint! Hint!) and post anything you find in a comment. The download is at: http://edgcm.columbia.edu/ModelII/modelII_source.zip as a simple zip file, so just about any OS can download and unpack it… (HINT! HINT!! HINT!!!)

With that, I’m off to cook dinner (We’re having pepperoni and kielbasa on Naan bread pizza … yum! With olives and lots of Mexican Mix cheese on it…) then I’ll be back to start looking at FFT and FORCINGS.

Subscribe to feed

Posted in AGW and GIStemp Issues, GCM | Tagged , , , | 4 Comments

Carping Comments – Idiots and “poseur”

It’s been a long while since we had a “Carping Comments” posting. Seems that aggressive discouragement of trolls, Alinsky Method attacks, and rudeness has generally removed the value from carping and insulting. I.e. no “emotional reward” so no bad behaviour.

Yet every so often some new person wonders by and just can’t resist tossing a firebomb. This one was on the https://chiefio.wordpress.com/2016/12/27/a-remarkably-tiny-global-circulation-model-you-can-run/ thread.

Now you might think that a posting consisting almost entirely of links to where you can download a GCM Global Circulation Model and run it (on a Mac or PC with 30 day free trial then a payment, or as source code to inspect) and then a cursory walk through the code mostly saying things like “This part seems to handle solar and that part looks to do clouds” would be about as uncontroversial as you can get. But some folks just have their hair catch on fire over most anything, and love to toss rocks at others to watch them duck. Perhaps it was my assertion that the program is forced to find CO2 causal and it makes forcings only from radiative gasses… yet that is what the code does. (Yes, there are other parameters, things like TSI, but they just flesh out the context for the ‘FORCING’ data)

So what was the “insult to the person” in this one?

“What an idiot you are, plus a poseur”

Now that kind of insult has exactly zero effect on me. First off, I know my I.Q., know I’m well above the acceptance level for Mensa (though still have not bothered to join… but it’s on my list of someday things). I’ve got my official I.Q. number, my SAT scores (that qualify me for Mensa all on their own) and my GMAT scores (that had Wharton School of Business solicit me to apply…) and more (including a NASA examination and …) all of which prove beyond any doubt that I’m not “an idiot”. So such insults are, at most, information about the bomb thrower. I don’t agree with them on some point, and they best they can muster is name calling… so most likely they are the ones of, shall we say, “diminished capacity”?

Then the other part “plus a poseur”. Since a “poseur” is someone pretending to be what they are not, and that posting was about being a computer programmer, the pertinent facts (which I’ve shared before, but the firelighter clearly doesn’t know) are: My first programming language was FORTRAN IV back in the early 1970s. I’ve been programming ever since (so about 45 years). I then learned COBOL (that I then avoided using for most of my professional career having seen what was in it…) and ALGOL (that is in many ways my favorite). Then ALGOL begat Pascal, that I’ve used. Which begat C, that I’ve used more. Also some PL/1 and one program in APL (that taught me never to use it again…) along with lots and lots of SH, KSH, and C shell scripting. Oh, and several database systems (being a Senior Consultant on the RAMIS II product in the ’80s) including FOCUS, HP Image and Query (oh, and used their Business Basic that is Basic created by a frustrated Pascal programmer – functions and long variable names and BEGIN END blocks and…) along with Sequel, Informix, and some others. Plus modest amounts of maintenance work on Perl and Ruby and Python and some others. Frankly, I’ve lost track of all the languages I’ve used at one time or another. (Oh, and was sent off to Germany once to evaluate an ADA Compiler for Amdahl…interesting language and better than JOVIAL, but a bit complex in the compiler making…)

So in the end, looking back on a lifetime of programming ranging from Mainframes to Supercomputers (life on the Cray was interesting… “supercompting is never having to say ‘now we wait for a response’…”) to several Mini computers (VAXen and Sun and HP and..) and just about every micro-computer from 286 and 6800 on up to now – including assembly language programming one built from piece parts with an Intel 8080? chip in it. Altair MITS? I think it was. Yes, this is it: https://en.wikipedia.org/wiki/Altair_8800 I find it hard to think of what, related to computers, I might be “posing” as that I haven’t actually done, several times…

I once took a contract to “bring up a Sun Server” for a new client. They wanted it done over the weekend. It was a 16? CPU box about the size of a refrigerator. Easy, takes about 3 hours if you are slow. Mostly just checking boxes and answering config questions. When I got there, I found the CFO had figured he could buy the ‘repair parts’ cheaper than the whole machine, so “bring it up” also consisted of installing the CPUs on the boards, installing memory, loading a base OS, etc. etc. That MITS experience paid off ;-) Well, long story short, “we had a talk” and renegotiated to “time and materials” and then I ran off to FRYs to get an allen wrench… the CPUs are held on by hex head screws at 6 inch-pounds IIRC.. and I calibrated my finger with a 1 lb can… there not being an inch pound torque wrench available at 9 PM on a Friday… Bottom line was I had it up and running on Monday Morning when it was critical to their production to have it running (another long story there…), but only on 12 CPUs as some of the CPU / board release levels were not compatible with others.

Now when you’ve done everything from building computers up from piece parts, installing operating systems and applications software, hacking Unix and Linux OS code, writing applications software that was sold commercially, managed data centers including a supercomputer center, and been an independent contractor doing ‘whatever is needed’ at dozens of companies for a decade or two (including network design and install at Sun’s Newark campus… several LARGE buildings – 3 Cisco Catalyst switches per building with fibre cross connects and a MAN…) AND installed it including wiring… Well, it’s a bit hard to see what I’m supposed to be “posing” about.

Running the Cray (for 7 1/2 years) was fun. It was mostly used for simulations. Moldflow for plastic injection flow modeling. Several secret CPU and computer simulations. And more. The key point being I have lot of years of High Performance Computing in the context of running computer models. Each Moldflow run was about 10 hours. For ONE well described fluid in ONE mold and ONE injection temperature… Oh, and on decommisioning, I let a Ph.D. student at Stanford run his “Cloud formation model” on the Cray for several days. (Well, really, for security reasons, I ran the codes after inspecting them, then returned the output when done… so you could say I’ve been running Climate and Cloud models from as early as the 1990s) He’d used all the time he was allowed at school, but didn’t have enough to finish his thesis. As we had spare cycles then, it was a nice gift to him (and he got his Ph.D.) As the computer was to be decommissioned in a couple of days, it wasn’t economical to sell the time (since at any minute we might pull the plug… site shutdowns are like that) So it can’t be about any unfamiliarity with computer models or high performance computing. Oh, and I built a 7 node Beowulf Cluster out of old machines “just for fun” in the early ’90s… and used to compile a BSD based ‘I.T. Department in a box’ product for one client. That’s the whole BSD plus enhancements and applications… so it can’t be per ‘distributed computing’.

So I’m left to assume the guy is just a 20 something (or an immature 30 something) who doesn’t have the experience to know what a Data Dictionary is, so assumes I’m making it up. It is a term of art from Mainframe Database use (mostly some years back, but still with currency) and a very useful term, but even in the ’80 we had a hard time getting most of the programmers to accept the importance of building one for their programs. (The main database guy made most of them after the fact when trying to get their applications to play well with others… and squeeze out data redundancy. This was at Amdahl Corp.) So I do it to this day.

It’s really a pretty simple idea. You collect the metadata about a data item and put it all in one place. Things like, oh, the name of it, what it contains, size, type, etc. For example:

Client Name, CNAME, 32 Characters, AlphaNumeric, used in: List of programs or databases.

Now if (or perhaps “since”) they don’t know that concept, and maybe do ‘by the seat of their pants’ maintenance programming at the junior level, they think I’m “posing” for saying I’m making a Data Dictionary. Yet I know I am doing it, and it is a Very Good Idea… Similarly, Block Diagram. I typically list all the subroutines, then graph out the MAIN program, then make a list of which block is called by which other and make a nice diagram of how all the blocks fit together. Now at that point, you have a decent idea what all the data items are, where they are used, and what they do, along with what processes the program does. ALL before you get into the down and dirty details of what happens inside any one block of actual code. Saves a lot of time. Reduces error rates greatly. Eases the workload on the mind. LOTS of benefits.

So what “poseur” tells me is this person lacks clue. (Lacks a lot of clues, actually… both about my personal history, and about good programming style and efficient program maintenance.) Given that, I’ve provided that clue in the above discussion.

Oh, and I’ve got a lifetime Teaching Credential at the Community College level in “Data Processing and Related Technologies”… so I do get a bit pedantic sometimes and do like to show folks better ways to marshal information and ideas. So yeah, I’m being a “bit the teach” in this posting. This also is part of why I try to speak in Standard English and not Tech Jargon. Sometimes I’ve had folks mistake that for lack of Tech Knowledge. In fact, it indicates a higher level of Tech Knowledge AND the ability to express it in different language styles.

Now, given all that, I think it’s pretty clear how “idiot and poseur” causes me to just smirk and chuckle. Clearly it is they who are waving the “idiot” flag around and just as clearly, they don’t have enough experience to gauge me and my experience (so just who is posing? Hmmm?)

So “Tkach thenos” gets added to the “forever moderated” list in WordPress. It is a nice little setting given to blog operators where they can list keywords that toss that posting into the moderation queue. Or SPAM.

And yes, that’s what I do with all folks who’s ability and ‘style’ limit them to Carping Comments. Things with zero intellectual interest and loads of insult and invective need not see the light of day nor trouble others. Trolls, firelilghters, Alynsky Acolytes and serial insulters especially “insult to the person”; have no place here. “Life is too short to drink bad wine!” and they are all piss and vinegar, so down the drain with them. If Tkach had read the “About” box they would have known that, but apparently “know your opponent” is not in their wheelhouse either…

OK, with that, I now return you to the rest of 2017, but with the hope that others can learn from this bit of Carping Comment commentary and behave accordingly. I know it’s a foolish hope, but I’m ever the optimist.

Subscribe to feed

Posted in Carping Comments | Tagged , , , | 13 Comments

Happy New Year! Goodbye 2016…

Being at the very last end of this spinning ball of time zones (though a tiny bit ahead of Hawaii…), I know I’m usually “late” on such global things compared to many of the folks out there. I’m trying to be a bit more “timely” this time (though I’ve already missed Australia and New Zealand… hope you guys got the party started right!)

With that, it’s time to say goodby to 2016 (and in some ways ‘good riddance’…) and hello to 2017.

Last year had a lot of interesting twists and turns, and hopefully 2017 will be a bit more sane. We’re free of the Democratic Party Yoke in Washington DC for at least a couple of years. Just have to worry about the ‘firelighters’ and ‘bomb throwers’ on their side disrupting things; and about what new ‘insta-grievance-group’ Soros will push on the world now that BLM and Occupy have been a bit of duds.

Only 3 more weeks of Obama Tantrums and Punchbowl Pissing to go, then he can fulfill his destiny as Sidewalk Supervisor and ankle biting yapper…

We’ve lost a lot of name actors this year. It’s not been a good year for Hollywood. I will only note that we lost both Princess Leia (and her mom Debbie Reynolds) and R2D2… TCM Turner Classic Movies runs a memorial spot each year showing the Names that have moved on that year. I recommend it, even if saddening.

“Climate Science” data fudgers suffered a big setback. Australia has given many ‘walking papers’ and Trump is set to do the same in the USA. Britain is headed for the door in the EU, so might also catch clue enough to dump their insane energy policies. (If the political winds are not enough, the sudden turn to cold and icy will likely drive the point home…)

The sun took A Big Nap, and now the atmospheric height has shortened as the mix of UV vs Visible vs IR has shifted to the red end (about 10% less UV) and though TSI has stayed near steady, the distribution of where the energy goes is ‘way different’ between UV (Stratosphere and deep ocean) and IR (prompt evaporation of water surfaces, rapid convection to space radiating levels over land). This squashing has also spread out the Polar Vortex, sending deep chills and snow into land masses from Central to Southern to Siberian Asia, parts of the EU, and nearly down to Texas in North America. Reports are that South America and New Zealand / Australia are having odd cold excursions too. A few more years of that and the nutbars pushing the Global Warming nonsense might just realize how foolish they look…

Only 20 more years of it until a bit of warming returns…

On a more positive note:

For Christmas I was given a set of Whisky Stones. These are 2 cm or so cubes of what looks like basalt. Placed in the freezer, they are used instead of ice cubes to cool the glass of ‘water of life’; thus avoiding dilution. Tested once, and pleasantly different from either “neat” or “on the rocks” (which, in this context, is an odd expression as it means ‘on the ice’ when the alternative is actual rock…)

So I’ll be giving them a slightly more extended trial, starting at about 9 PM Pacific, with the helpf of a bit of Speyburn 10 year Highland Single Malt. A very nice drop of which not nearly enough survived the first test of the ‘whisky stones’ ;-)

May 2017 continue the political trends set in motion in 2016, and may “climate science” learn how to do actual science and avoid “political science” as the winds of change get stronger.

Cheers!

Subscribe to feed

Posted in Human Interest, News Related | Tagged , | 21 Comments

Tips – January 2017

About “Tips”:

While I’m mostly interested in things having to do with:

Making money, usually via trading
Weather and climate
Quakes, Volcanoes, and other Earth Sciences
Current economic and political events
(often as those last three have impact on the first one…)
And just about any ‘way cool’ interesting science or technology

If something else is interesting you put a “tip” here as you like.

You can also look at the list of “Categories” on the right hand side and get an idea of any other broad area of interest.

This ought not to be seen as a “limit” on what is “interesting”, more as a “focus list” with other things that are interesting being fair game as well.

The History:

Note that “pages” are the things reached from links on the top bar just under the pretty picture. “Postings” are reached from the listing along the right side of the articles.

Since WordPress has decided that comments on Pages, like the Tips pages, don’t show up in recent comments, it kind of breaks the value of it for me. In response, I shifted from a set of “pages” to a set of “postings”. As any given Tips Posting gets full, I’ll add a new one.

I have kept the same general format, with the T page (top bar) still pointing to both the archive of Tips Pages as well as the series of new Postings via a link to the TIPS category.

This is the next posting from prior Tips postings as they had gotten so large it was taking a long time to load. Same idea, just a new set of space to put pointers to things of interest. The most immediately preceding Tips posting is: https://chiefio.wordpress.com/2016/12/02/tips-december-2016/.

The generic “T” parent page remains up top, where older copies of the various “Tips” pages can be found archived. The Tips category (see list at right) marks Tips postings for easy location.

Subscribe to feed

Posted in Tips | Tagged , , | 31 Comments

TT – Only 3 More Weeks!

And Counting….

The Trump Transition “TT” at minus 3 weeks. (We skipped -4 as I started 5 late)

December is going going (gone), and 3 more in January. Sporadically I’ll put up additional TT posts as any one gets too full to load quickly, or as some event causes me to desire to put a head post up on the topic.

Prior threads in the chain are:

https://chiefio.wordpress.com/2016/12/20/tt-minus-5-weeks/

https://chiefio.wordpress.com/2016/12/14/tt-minus-6-weeks/

https://chiefio.wordpress.com/2016/12/02/tt-minus-7-weeks/

https://chiefio.wordpress.com/2016/11/23/tt-minus-8-weeks/

https://chiefio.wordpress.com/2016/11/08/hillary-trump-the-election-and-aftermath/

https://chiefio.wordpress.com/2016/11/16/democrats-lords-of-chaos-choose-defiance/

In this installment, we have Obama “punishing” the Russians (more street theatre for effect from the Organizer In Chief?) for their “hacking” – ignoring that under the PRISM program the USA demanded that companies like Microsoft, Apple, Cisco, etc. etc. ship products pre-hacked for the convenience of the USA TLAs (Three Letter Agencies, like FBI, CIA, NSA, etc…) Oh, and ignore those Chinese hackers ripping of any information not buried in a Mayonnaise Jar in the back yard…

IMHO, what we have is Obama as Graffiti Artist and Street Thug. He’s pissing in the punch bowl at the party and breaking windows anywhere he can find them. But what do you expect from an immature Marxist trained as a Community Organizer (i.e. professional rabble rouser and creator of angry mobs). All while his “party” just watches and says nothing, or worse, praises this tantrum. Destruction for destruction’s sake and attempts to prevent Trump from governing wherever he can. Somehow I think Trump is just not going to care, and will get on with the business of fixing the broken windows and replacing the punch in a smooth and efficient manner.

Hey, it’s Obama’s Legacy, and if he wants it to be “Brat having a tantrum, throwing rocks and pissing on the carpet”, so be it. I know it’s helping to assure I never vote for a Democrat again… (Full Disclosure: I voted for Obama in the California Primary in his first run… Oh the shame… but I was an ABC voter – Anyone But Clinton.)

With that: Let the conversing commence!

Subscribe to feed

Posted in Political Current Events | Tagged , , | 14 Comments

Brave Browser has Promise

Glenn999 had a ‘tip’ (mysteriously out of place on a non-tip thread ;-) about the “Brave” browser. I took a look at their web site. It has promise. So h/t to Genn999 for that.

I’m not easily impressed by Yet Another Browser. This one has goals that make it stand out some. Specifically the emphasis on suppression of ads, malware, trackers and such, while incorporating ways to let you pay folks whose content you want to support. Both via ‘allow’ lists for their ads, and via direct ‘micropayments’ with Bitcoins.

https://brave.com/

From their ABOUT tab:

We have a mission to save the web by increasing browsing speed and safety for users, while growing ad revenue share for content creators.

The web has become a different place. With the ad-tech ecosystem out of control, users have revolted and blocking ads has become the new weapon of choice for improving their browsing speed, safety and privacy. Unfortunately, blocking alone results in a race to the bottom where nobody wins. Without the ability for content creators to earn money for their efforts, users could be left with fewer sites to browse, relegated to hand-picked content from controlled sources.

Brave aims to transform the online ad ecosystem with micropayments and a new revenue-sharing solution to give users and publishers a better deal, where fast, safe browsing is the path to a brighter future for the open web.

And from their “faster” tab:

Browse Faster

Brave blocks trackers and intrusive ads that can slow you down on the web.

Browse Safer

Brave keeps you and your information safer, effectively shielding you from 3rd party tracking and malvertisement.

Browse Better

With Brave, you can choose whether to see ads that respect your privacy or pay sites directly. Either way, you can feel good about helping fund content creators.

So it’s all very interesting…

Now the downside: It doesn’t have a binary for the ARM Linux world.

You can get it for Android devices, so it has an ARM version. You can get it for Linux (as an AMD_64 binary…). And you can download sources and ‘roll your own’.

As I’m already up to my eyeballs in time eating alligators (GCMs…) I’m not able to sink time into making a tarball that works on the Pi starting from raw source trees. That means I’m unlikely to try the browser any time soon. (As of now, I only use the Intel chip boxes on very rare occasions. About once / month or less… and then not typically for browsing but for some obscure MS Windoz thing…)

So it goes onto my “someday” list…

But: YMMV, so have at it!

It addresses all the major issues I have with the present available browsers, on which I’ve spent many hours. Building that whole “ground ads via DNS spoofing” thing for example. It would be nice to have someone else killing the ads for me ;-) But since I do have it installed and running, the benefit to me of the work of porting Brave is lessened. However, if you have NOT made such a system, and live on Intel based machines, it looks like you might be one ‘download and install’ away from significantly faster web browsing with enhanced security too.

If anyone gives it a test drive, it would be nice to have a ‘user report’ (or two or three or…)

Subscribe to feed

Posted in Tech Bits | Tagged , , , | 25 Comments

Inside GCM Model II

Earlier I did the ‘where to find it how to get it what’s in the box’ posting on NASA GISS GCM Model II in this posting:

https://chiefio.wordpress.com/2016/12/27/a-remarkably-tiny-global-circulation-model-you-can-run/

At the end of the process (down in comments) I’d gotten the thing to compile under Linux. The short form is:

Download.
Unzip.
Edit Makefile and replace the SVNVER variable ‘discovery’ of what svn version you have with
SVNVER=0.0
Edit RANDVAX.f and setpath.f to remove the “_” character from names of functions
Copy Makefile.gfortran to Makefile.pi and comment out the LIBS= line:
#LIBS = -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib

At that point “make” and then “make -f makefile.pi” ought to build it.

At that point you discovery it wants a bunch of fairly complicated input configuration files that are not in the software download. I’m working on getting or creating those… While that happens, I’m doing a bit of code review on the package.

In the earlier posting I noted those small FORTRAN and other source files that were not the core of the program. Things like the GUI added bits and some Macintosh glueware to make it go on a Mac. In this posting, I’ll be looking at the larger bits that were not examined then. (Likely this one and some more as there are 5 large code blocks and I think one per posting is likely the limit. We’ll see as I write them…)

Here’s a listing fo the files you get in the downloaded source tarball:

sh-4.3$ ls -l
-rw-r--r-- 1 chiefio chiefio   3926 Aug  2  2005 B83XXDBL.COM
-rw-r--r-- 1 chiefio chiefio   3164 Aug  2  2005 BA94jalC9.COM
-rw-r--r-- 1 chiefio chiefio 240095 Apr 17  2008 DB11pdC9.f
-rw-r--r-- 1 chiefio chiefio  13208 Aug  2  2005 FFT36macDBL.f
-rw-r--r-- 1 chiefio chiefio   5362 Aug  2  2005 FORCINGSjalC9.f
-rw-r--r-- 1 chiefio chiefio   1333 Aug  2  2005 FORCINGSmac.COM
-rw-r--r-- 1 chiefio chiefio    876 Mar 23  2006 Info.plist
-rw-r--r-- 1 chiefio chiefio    906 Dec 27 23:00 Makefile
-rw-r--r-- 1 chiefio chiefio    612 May 12  2008 Makefile.Mac.PPC
-rw-r--r-- 1 chiefio chiefio   3145 Apr 18  2008 Makefile.README
-rw-r--r-- 1 chiefio chiefio    747 Apr  1  2008 Makefile.gfortran
-rw-r--r-- 1 chiefio chiefio    706 May 12  2008 Makefile.ifort
-rw-r--r-- 1 chiefio chiefio   9238 Apr 17  2008 Makefile.win
-rw-r--r-- 1 chiefio chiefio   2252 Apr 17  2008 Makefile.win.gui
-rw-r--r-- 1 chiefio chiefio 204365 Mar 23  2006 Mjal2cpdC9.f
-rw-r--r-- 1 chiefio chiefio 331692 Jan 17  2006 Pjal0C9.f
-rw-r--r-- 1 chiefio chiefio     59 Aug  2  2005 PostBuild.sh
-rw-r--r-- 1 chiefio chiefio 555793 Aug  2  2005 R83ZAmacDBL.f
-rw-r--r-- 1 chiefio chiefio   1248 Dec 27 22:58 RANVAX.f
-rw-r--r-- 1 chiefio chiefio   1427 Aug  2  2005 RANVAXxlf.f
-rw-r--r-- 1 chiefio chiefio   3339 Mar 13  2007 README.f.in
-rw-r--r-- 1 chiefio chiefio 128314 Aug  2  2005 RFRCmacDBL.f
-rw-r--r-- 1 chiefio chiefio   4203 Jan 18  2006 UTILmacDBL.f
-rw-r--r-- 1 chiefio chiefio   4202 Dec 14  2006 UTILwinDBL.f
-rw-r--r-- 1 chiefio chiefio   5548 Jan 17  2006 commandlinetest.gui
-rw-r--r-- 1 chiefio chiefio  11887 Aug  2  2005 modelF.r
-rw-r--r-- 1 chiefio chiefio   1475 Aug  2  2005 mrweprefs.r
-rw-r--r-- 1 chiefio chiefio    132 Aug  2  2005 pd_COMMON
-rw-r--r-- 1 chiefio chiefio   1321 Dec 27 22:58 setpath.f

Of those, I’ve already mentioned that the COMMON and .COM files are FORTRAN common blocks (definitions of what variables and arrays will be shared by several programs for data passing), the .r files are for Macintosh compatibility use, and the Makefile.x set are custom build scripts for different environments (with Makefile doing a set-up step then telling you to run one of the others). README.f.in is processed by Makefile to produce README.f which looks like it just sticks a ‘edGCM branding’ comment on the tops of programs. Also, I’d looked at setpath.f (that does a workaround for execution path setting in some environments) and RANDVAX files that basically is a “call random” function for making pseudo-random numbers. The “commanlinetest.gui” didn’t interest me as I’m not using the edGCM GUI code (that is proprietary and licensed for a fee…) also the PostBuild.sh shell script that is a one line “copy the executable to your bin directory” trivial “scrip”. That leaves info.plilst and a very few FORTRAN programs to look at next.

-rw-r--r-- 1 chiefio chiefio 240095 Apr 17  2008 DB11pdC9.f
-rw-r--r-- 1 chiefio chiefio  13208 Aug  2  2005 FFT36macDBL.f
-rw-r--r-- 1 chiefio chiefio   5362 Aug  2  2005 FORCINGSjalC9.f
-rw-r--r-- 1 chiefio chiefio    876 Mar 23  2006 Info.plist
-rw-r--r-- 1 chiefio chiefio 204365 Mar 23  2006 Mjal2cpdC9.f
-rw-r--r-- 1 chiefio chiefio 331692 Jan 17  2006 Pjal0C9.f
-rw-r--r-- 1 chiefio chiefio 555793 Aug  2  2005 R83ZAmacDBL.f
-rw-r--r-- 1 chiefio chiefio 128314 Aug  2  2005 RFRCmacDBL.f
-rw-r--r-- 1 chiefio chiefio   4203 Jan 18  2006 UTILmacDBL.f
-rw-r--r-- 1 chiefio chiefio   4202 Dec 14  2006 UTILwinDBL.f

A MUCH smaller set of things to look at, no? I’m going to take them more or less in order of increasing size. Why? To clear out the small and simple stuff quickly, leaving on the larger core to chew on at length. Often this is the best way to discover out a new package works. Nibble off the edges until you are left with a few things to figure out…

So first up, “Info.plist”:

This is just FILLED with angle brackets. Since WordPress strips out all things angle bracket, and I’m not interested in typing a few hundred obscure escape codes to show them, I’m just going to replace them with square brackets for display purposes.

[?xml version="1.0" encoding="UTF-8"?]
[!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"]
[plist version="0.9"]
[dict]
      	[key]CFBundleExecutable[/key]
	[string]modelII 8x10x9[/string]
	[key]CFBundleIdentifier[/key]
	[string]com.edgcm.modelII[/string]
	[key]CFBundleInfoDictionaryVersion[/key]
	[string]6.0[/string]
	[key]CFBundlePackageType[/key]
	[string]APPL[/string]
	[key]CFBundleSignature[/key]
	[string]eGCM[/string]
	[key]CFBundleVersion[/key]
	[string]1.0.7[/string]
	[key]CSResourcesFileMapped[/key]
	[true/]
	[key]CFBundleIconFile[/key]
	[string]modelII.icns[/string]
	[key]CFBundleShortVersionString[/key]
    [string]1.0.7 Model II[/string]
    [key]CFBundleLongVersionString[/key]
    [string]1.0.7, GISS GCM Model II (8x10 or 7.826x10, 9-layer)[/string]
    [key]NSApplescriptEnabled[/key]
    [string]No[/string]
[/dict]
[/plist]

“Propertylist” and with an xml tag at the tope. Looks to me like a bunch more of the GUI oriented stuff that I’m not bothering with. OK, moving on…

UTILmacDBL.f and UTILwinDBL.f

As you might guess from their name, these are a Mac and Windows version of the same thing. A “diff” on them shows little difference. The Windows version has “clock90” while the Mac version has “secnds(0.0)”. I’ve preplaced the angle brackets in the ‘diff’ output below with [ and }.

sh-4.3$ diff UTILmacDBL.f UTILwinDBL.f 
33c33
{       IHSC = secnds(0.0)
---
} c      IHSC = secnds(0.0)
35c35
{ c      IHSC = clock()
---
}       IHSC = clock()
124c124
{       MNOW  = secnds (0.0)      
---
} c     MNOW  = secnds (0.0)      
126c126
{ c      MNOW = clock()
---
}       MNOW = clock()

So what’s the Mac version look like in total? It is 131 lines.

sh-4.3$ cat UTILmacDBL.f 
c  *********************************************************************
c  *********************************************************************
c  **
c  ** Model IImac
c  ** Based on GCMII code for IBM RS/6000 computers created at GISS
c  ** Modified to compile under Absoft Pro Fortran 6.2 for MacOS.  
c  ** Based on MP008macC9, BA94C9 and MA94DC9
c  **
c  ** CHANGE HISTORY:
c  **
c  ** 7/27/99 First Successful Compile! (DCH)
c  ** 7/27/99 Changed MCLOCK() call to DTIME() unix call (DCH)
c  ** 7/30/99 Patched DTIME to 4 to make it compile
c  ** 11/01/99 Another patch to work as a shared lib (MFS)
c  ** 12/21/00 Try with another version of Model II (MFS)
c  ** 09/28/02 Use clock() to replace MCLOCK() (MFS)
c  ** 01/27/05 working MCLOCK (GLR)
c  ** 01/17/06 reverted to CLOCKS, secnds on Mac, clock on Win (MFS)
c  **
c  ** NOTES:
c  **  Not sure if DTIME does the same thing as MCLOCK, but Reto believe
c  **  all calls to CLOCKS are not important to the running of the model
c  **
c  *********************************************************************
c  *********************************************************************

c  MS SYSTEM ROUTINES EMULATION FOR IBM RS/6000
c

Looks like a collection of a few Utility Functions. We’ll break them out. First, the “clocks” function:

OK, so it gets run times of executions. Might need to fiddle with just what function is called, but the Mac, being Mach based and using gfortran build likely uses a Linux compatible call. And, as the comment notes, not really important to the actual model. Likely used just to display run time info in the presentation phase of the GUI anyway (or annotated into a run log file.).

      SUBROUTINE CLOCKS(IHSC)
c  THIS VERSION OF CLOCKS RETURNS PROCESS TIME OF USER AND
c  SYSTEM TIME OF CHILD PROCESSES
c  NOTE: MCLOCK IS REALLY IN HUNDREDTHS OF A SECOND, NOT SIXTIETHS.
      IHSC = secnds(0.0)
c  ** Windows should use
c      IHSC = clock()
      RETURN
      END

THBAR looks like some thermobaric calculations. The top comment block presents what they think they are doing. I note that they commented out an older FORTRAN style of the DATA statement and replaced it with the newer PARAMETER form. Nothing like gratuitous changes to a language spec over time to keep programmers employed…

      FUNCTION THBAR (X,Y)
c  **
c  ** TH-mean used for vertical differencing (Arakawa)
c  ** THBAR(T1,T2) = (ln(T1) - ln(T2))/(1/T2 - 1/T1)
c  **              = T1*g(x) with x=T1/T2 , g(x)=ln(x)/(x-1)
c  **      g(x) is replaced by a rational function
c  **           (a+bx+cxx+dxxx+cx**4)/(e+fx+gxx)
c  **      approx.error <1.E-6 for x between .9 and 1.7
c  **
c     REAL*8 A,B,C,D,E,F,G,Q,AL
      IMPLICIT REAL*8 (A-H,O-Z)
      PARAMETER (
     *  A=113.4977618974100d0,B=438.5012518098521d0,
     *  C=88.49964112645850d0,D=-11.50111432385882d0,
     *  E=30.00033943846368d0,F=299.9975118132485d0,
     *  G=299.9994728900967d0)
c     DATA A,B,C,D,E,F,G/113.4977618974100,438.5012518098521,
c    *  88.49964112645850,-11.50111432385882,
c    *  30.00033943846368,299.9975118132485,299.9994728900967/
      Q=X/Y
      AL=(A+Q*(B+Q*(C+Q*(D+Q))))/(E+Q*(F+G*Q))
      THBAR=X*AL
      RETURN
      END

No idea at this point what EXPBYK does. Send it X, it raises X to the power 0.286, but why?

(“Why? Don’t ask why. Down that path lies insanity and ruin. -E.M.Smith”… we will be exploring ‘why’ when we get to the code that calls EXPBYK …

      FUNCTION EXPBYK (X)
      IMPLICIT REAL*8 (A-H,O-Z)
      EXPBYK=X**.286
      RETURN
      END

DREAD function looks like it just does a REAL ARRAY of 4 bytes to REAL 8 byte length conversion. Ah, the joys of data type mismatch… With 64 bit machines common now, one could likely get a speed up by eliminating this function and making all such things 8 bytes long in the mainline code. Change “reals” to “doubles”.

      SUBROUTINE DREAD (IUNIT,AIN,LENGTH,AOUT)
c  **
c  ** READ IN REAL*4 ARRAY AND CONVERT TO REAL*8
c  **
      REAL*4 AIN(LENGTH)
      REAL*8 AOUT(LENGTH)
      READ (IUNIT) AIN
      DO 10 N=LENGTH,1,-1
   10 AOUT(N)=AIN(N)
      RETURN
      END

And the same thing for Integers…

      SUBROUTINE MREAD (IUNIT,M,NSKIP,AIN,LENGTH,AOUT)
c  **
c  ** READ IN INTEGER & REAL*4 ARRAY AND CONVERT TO REAL*8
c  **
      REAL*4 AIN(LENGTH),X
      REAL*8 AOUT(LENGTH)
      READ (IUNIT) M,(X,N=1,NSKIP),AIN
      DO 10 N=LENGTH,1,-1
   10 AOUT(N)=AIN(N)
      RETURN
      END

Then again, the same idea for the TITLE… Title of what? Maybe later… ;-)

      SUBROUTINE READT (IUNIT,NSKIP,AIN,LENGTH,AOUT,IPOS)
c  **
c  ** READ IN TITLE & REAL*4 ARRAY AND CONVERT TO REAL*8
c  **
      REAL*4 AIN(LENGTH),X
      REAL*8 AOUT(LENGTH)
      CHARACTER*80 TITLE
      DO 10 N=1,IPOS-1
   10 READ (IUNIT,END=920)
      READ (IUNIT,ERR=910,END=920) TITLE,(X,N=1,NSKIP),AIN
c     IF(LEN.LT.4*(20+NSKIP+LENGTH)) GO TO 930
      DO 100 N=LENGTH,1,-1
  100 AOUT(N)=AIN(N)
      WRITE(6,'('' Read from Unit '',I2,'':'',A80)') IUNIT,TITLE
      RETURN
  910 WRITE(6,*) 'READ ERROR ON UNIT',IUNIT
      STOP 'READ ERROR'
  920 WRITE(6,*) 'END OF FILE ENCOUNTERED ON UNIT',IUNIT
      STOP 'NO DATA TO READ'
c  30 WRITE(6,*) LEN/4,' RATHER THAN',20+NSKIP+LENGTH,' WORDS ON UNIT',
c    *  IUNIT
c     STOP 'NOT ENOUGH DATA FOUND'
      END

Then we have a ‘timer’ routine. So it is keeping track of run times internally. OK, I’d likely put that external, but whatever. Key bit is it isn’t critical to the actual model nor understanding it.

      SUBROUTINE TIMER (MNOW,MINC,MSUM)
c  **
c  ** OUTPUT: MNOW (.01 S) = CURRENT CPU TIME
c  **         MINC (.01 S) = TIME SINCE LAST CALL TO SUBROUTINE TIMER
c  **         MSUM (.01 S) = MSUM + MINC
c  **
      SAVE MLAST
      MNOW  = secnds (0.0)      
c  ** Windows should use
c      MNOW = clock()
      MINC  = MNOW - MLAST
      MSUM  = MSUM + MINC
      MLAST = MNOW
      RETURN
      END

Forcings? There MUST be FORCINGs…

Next up is that FORCINGSjalC9.f file. It is 175 lines long. Hopefully not too much density in them… I suspect, though, that this will tip the hand about what is expected to produce the desired results from the model.

sh-4.3$ cat FORCINGSjalC9.f 
c  *********************************************************************
c  *********************************************************************
c  **
c  ** Model IImac
c  ** Based on GCMII code for IBM RS/6000 computers created at GISS
c  ** Modified to compile under Absoft Pro Fortran 7.0 for MacOS 9/X.  
c  ** Code to do trends
c  ** 
c  ** CHANGE HISTORY:
c  ** 
c  ** 05/27/02 new S0X code (MSC/MFS)
c  ** 06/03/02 new greenhouse gas trend code (MSC/MFS)
c  ** 06/10/02 fixed bug so it reads the first year (MFS)
c  ** 06/17/02 fixed logic error in code (MFS)
c  ** 06/19/02 moved joldyear to the common block (MFS)
c  ** 05/06/04 added fixed var to include END (MAC)
c  ** 05/27/04 changed JOLDYEAR to array with 5 values (=NGAS) (MAC)
c  ** 06/22/04 removed extra defined jyear (MFS)
c  ** 03/16/05 fix format statement (MFS/Patrick Lee/JAL)
c  ** 
c  ** NOTES:
c  ** This code replaces RFRC
c  ** 
c  *********************************************************************
c  *********************************************************************

Hmmm… there is also a RFRCmacDBL.f program, so one presumes RFRC is short for Radiative FoRCing or some such. OK, we’ve got Sulphur Oxides SOX, a Greenhouse Gas Trend setting, and some things about radiative forcing. Wonder if we’ll find anything else…

      SUBROUTINE SOLARFORCING
c  ** reads the solar trend, replaces code in RFRC
c  ** does both trends and fixed
      INCLUDE 'BA94jalC9.COM'
      INCLUDE 'FORCINGSmac.COM'
c  ** var
      INTEGER*4 JDATAYEAR
      REAL*8 DATAVALUE
      REAL*8 XXGAS
      INTEGER*4 OLDYEAR
      DATA OLDYEAR/-999/
      
      IF((IS0XDATA.GT.0).AND.(JYEAR.GE.IS0XDATASTART))THEN
        IF(OLDYEAR.NE.JYEAR)THEN
          XXGAS=GREENHOUSEGASFORCING(IS0XDATA,IS0XDATASTART,
     *      IS0XDATAEND)
          OLDYEAR=JYEAR
         END IF
        S0X=XXGAS
      END IF
      END

So it DOES have a “Solar Forcing” aspect. Here it reads in 2 COMmon blocks for sharing data. We’ll look at those just below this program. It looks like it uses Julian Date (JDATEYEAR) to maybe drive a solar orbital mechanics variation in sunshine? Nice to have that in, now just to get the values right ;-) Or perhaps it is just to puck up gas forcing based on year… We’ll need to read more of the guts of it to see what it really does.

Then it does a VERY direct “make greenhouse gasses force things this much based on year” near as I can tell (at this point and from function names…). Note to self: Find “GREENHOUSEGASFORCING” function and see what it does… (a ‘grep’ of all things .f shows it is only in this program… so down below somewhere).

DATA-REF-Year

I like the “goes very weird” comment ;-) So water vapor, CO2, Ozone, Oxygen (why oxygen?, NOx, Methane, and some Freons… The 4211, 12, and 13 are line numbers in the original file.

Again, it includes the COMmon block for sharing data.

Overall, looks like it just forces XGAS to 1958 values to “avoid weirdness”… Then packs JOLDYEAR with a bad data value of -999 (common marker in FORTRAN era stuff to show it isn’t zero but empty).

      SUBROUTINE DATAREFYEAR(XGAS,YEAR,NGAS)
c  ** for reference purposes 1958 values always have to be certian
c  ** constants or the scaling goes very weird, Andy warned me
c  **
c  ** Here are the original lines from R83ZAmacC9
C                 H2O   CO2  O3      O2 NO2   N2O   CH4   CCL3F1 CCL2F2 4211.   
C     DATA FULGAS/1.0,  1.0,1.0,    1.0,1.0,  1.0,  1.0,    1.0,    1.0/4212.   
c     DATA PPMV58/0.0,315.0,0.0,210000.,0.0,0.295,1.400,8.00E-6,25.0E-6/4213.   
      INCLUDE 'FORCINGSmac.COM'
c  ** var
      REAL*8 XGAS(5)
      REAL*8 YEAR
      INTEGER*4 NGAS
c  ** set xgas to 1958 values
      XGAS(1) = 315.
      XGAS(2) = 0.295
      XGAS(3) = 1.400
      XGAS(4) = 8.00E-6 * 1000.D0
      XGAS(5) = 25.0E-6 * 1000.D0
c  ** setup joldyear
      DO 100 I=1,NGAS
      JOLDYEAR(I) = -999
  100 CONTINUE
      END

This next bit lets you load in any ‘trend’ you would like in a data stream. It is to avoid hard coding trends. So it will tell us the format of the “trend” files… that look to have a year marker and then what the trend ought to be in that year. Again, the two common COMMON blocks… I note in passing the use of lots of *GAS* variables, solar and tidal and cosmic rays and orbital not so much… Gee, I wonder why it finds GH GAS as an important driver and not solar…

So basically this reads in the trends in GHG that you set, then down below it calculates what temperature “forcing” that would make, then eventually you get the temperature increase at the end…

      SUBROUTINE DATAFILETREND(XGAS,YEAR,NGAS)
c  ** file based trend code to run any trend you want without having to
c  ** recompile the model. updates the trends from the file once a year
c  ** and caches the values inbetween. 
      INCLUDE 'BA94jalC9.COM'
      INCLUDE 'FORCINGSmac.COM'

      REAL*8 XGAS(5)
      REAL*8 XXGAS(5)
      REAL*8 YEAR
      INTEGER*4 NGAS
        
      IF((ICO2DATA.GT.0).AND.(JYEAR.GE.ICO2DATASTART))THEN
        IF(JOLDYEAR(1).NE.JYEAR)THEN
          XXGAS(1)=GREENHOUSEGASFORCING(ICO2DATA,ICO2DATASTART,
     *      ICO2DATAEND)
          JOLDYEAR(1)=JYEAR
         END IF
        XGAS(1)=XXGAS(1)
      ELSE
        XGAS(1)=CO2
      END IF
        
      IF((IN2ODATA.GT.0).AND.(JYEAR.GE.IN2ODATASTART))THEN
        IF(JOLDYEAR(2).NE.JYEAR)THEN
          XXGAS(2)=GREENHOUSEGASFORCING(IN2ODATA,IN2ODATASTART,
     *      IN2ODATAEND)
          JOLDYEAR(2)=JYEAR
        END IF
        XGAS(2)=XXGAS(2)
      ELSE
        XGAS(2)=ZN2O
      END IF
        
      IF((ICH4DATA.GT.0).AND.(JYEAR.GE.ICH4DATASTART))THEN
        IF(JOLDYEAR(3).NE.JYEAR)THEN
          XXGAS(3)=GREENHOUSEGASFORCING(ICH4DATA,ICH4DATASTART,
     *      ICH4DATAEND)
          JOLDYEAR(3)=JYEAR
        END IF
        XGAS(3)=XXGAS(3)
      ELSE
        XGAS(3)=CH4
      END IF
        
      IF((IF11DATA.GT.0).AND.(JYEAR.GE.IF11DATASTART))THEN
        IF(JOLDYEAR(4).NE.JYEAR)THEN
          XXGAS(4)=GREENHOUSEGASFORCING(IF11DATA,IF11DATASTART,
     *      IF11DATAEND)
          JOLDYEAR(4)=JYEAR
        END IF
        XGAS(4)=XXGAS(4)
      ELSE
        XGAS(4)=F11
      END IF
      
      IF((IF12DATA.GT.0).AND.(JYEAR.GE.IF12DATASTART))THEN
        IF(JOLDYEAR(5).NE.JYEAR)THEN
          XXGAS(5)=GREENHOUSEGASFORCING(IF12DATA,IF12DATASTART,
     *      IF12DATAEND)
          JOLDYEAR(5)=JYEAR
        END IF
        XGAS(5)=XXGAS(5)
      ELSE
        XGAS(5)=F12
      END IF
        
      END

Once more, the two common blocks for sharing data. For a given JDATAYEAR (line 10) it reads in a given DATAVALUE, then sets the GREENHOUSEGASFORCING to that value. Nice…

      FUNCTION GREENHOUSEGASFORCING(IDATAUNIT,ISTARTDATA,IENDDATA)
c  ** reads a greenhouse gas trend and gives the result back
c  ** to the rest of the code, replaces code in RFRC
      INCLUDE 'BA94jalC9.COM'
      INCLUDE 'FORCINGSmac.COM'
c  ** var
      INTEGER*4 IDATAUNIT,ISTARTDATA,IENDDATA
      INTEGER*4 JDATAYEAR
      REAL*8 DATAVALUE
      REAL*8 GREENHOUSEGASFORCING
      
      IF(IDATAUNIT.GT.0)THEN
   10   READ(IDATAUNIT,900,ERR=100,END=100) JDATAYEAR,DATAVALUE
        IF(JDATAYEAR.EQ.JYEAR)THEN
          GREENHOUSEGASFORCING=DATAVALUE
        ELSE IF(JDATAYEAR.LT.JYEAR)THEN
          GO TO 10
        ELSE
          GO TO 110
        END IF
      ELSE
c  ** default is to do nothing        
      END IF 
c  ** sucess      
      RETURN
c  ** errors     
  100 STOP 'Error: Data file ends before current year.\n'
  110 STOP 'Error: Data file begins after current year.\n'
c  ** format
  900 FORMAT(I4,T6,F15.8)
      END

The COMMON blocks

OK, just for completeness, here are those COMMON blocks. Note that this just says what variables are global to the whole program. Any code that has an include of these variables can change them and share the results with others. This can cause no end of grief in debugging if you are not careful, but is very useful for sharing data structures.

sh-4.3$ ls -l *COM* 
-rw-r--r-- 1 chiefio chiefio 3926 Aug  2  2005 B83XXDBL.COM
-rw-r--r-- 1 chiefio chiefio 3164 Aug  2  2005 BA94jalC9.COM
-rw-r--r-- 1 chiefio chiefio 1333 Aug  2  2005 FORCINGSmac.COM
-rw-r--r-- 1 chiefio chiefio  132 Aug  2  2005 pd_COMMON

So there are 3 total. Note that “pd_COMMON” is not a FORTRAN common block like the others, involved in the model operation:

sh-4.3$ cat pd_COMMON 
      character*80 clabel
      equivalence (clabel,xlabel)
      common/pd_com/iprint_pd(12),iu_pd(12),iform_pd(12),iNetcdf_pd(12)

It has to do with printing out some things…

The FORCINGSmac.COM file

So what does FORCINGSmac.COM look like? BTW, the comments indicate changes over time. That implies strongly some other code that USED this common block to pass data changed then too.

sh-4.3$ cat FORCINGSmac.COM 
c  *********************************************************************
c  *********************************************************************
c  **
c  ** Model IImac
c  ** Based on GCMII code for IBM RS/6000 computers created at GISS
c  ** Modified to compile under Absoft Pro Fortran 6.2 for MacOS.  
c  ** Based on BRCRFmac.COM
c  **
c  ** CHANGE HISTORY:
c  **
c  ** 05/27/02 new S0X code (MFS)
c  ** 06/07/02 added ktrend (MFS)
c  ** 06/15/02 renamed ktrend to ktrendext(MFS)
c  ** 06/19/02 moved joldyear to here (MFS)
c  ** 05/27/04 changed JOLDYEAR to array with MGAS values (=NGAS) (MAC)
c  **
c  ** NOTES:
c  **
c  *********************************************************************
c  *********************************************************************

c  ** force reals to be real*8
c      IMPLICIT REAL*8 (A-H,O-Z)
c  ** new common for INPUTFORCINGS
      PARAMETER (MGAS=5)
      COMMON/IFORCINGS/
     *  KTRENDEXT, JOLDYEAR(MGAS),
     *  ICO2DATA, ICO2DATASTART, ICO2DATAEND,
     *  IN2ODATA, IN2ODATASTART, IN2ODATAEND,
     *  ICH4DATA, ICH4DATASTART, ICH4DATAEND,
     *  IF11DATA, IF11DATASTART, IF11DATAEND,
     *  IF12DATA, IF12DATASTART, IF12DATAEND,
     *  IS0XDATA, IS0XDATASTART, IS0XDATAEND,
     *  IVOLDATA, IVOLDATASTART, IVOLDATAEND
      COMMON/RFORCINGS/
     *  ZN2O, CH4, F11, F12, VOL

So the block is all REAL*8 or 64 bit values. I wonder if MGAS stands for Magic Gas ;-)

The forcings look like a trend external file, CO2, NOx, Methane, Freons, SOx and “IVOLDATA”… Volume? In any case, it’s pretty clear what is going to drive ANY temperature change in this “model”. It is just looking for Magic Gas effects, nothing else.

The BA94jalC9.COM file

That BA94jalC9.COM file has more meat in it, but we don’t know what it is used for yet. The comment about “to change the grid” in the second comment (after the intro block) implies it is a data structure for the actual grid status. We’ll see if that speculation holds. Remember that in FORTRAN, varables named starting with I through N are INTEGER types, so something like IFROG is being cast as an INT with the leading I and it likely does NOT have meaning beyond that if the rump has meaning alone. You will see a lot of varuables like JM and KTD that are likely things like (integer)M and (integer)TD. But who knows. Folks often play games with it and you can change those defaults with an explicit type assignmnet (though it is considdered a bit rude…)

sh-4.3$ cat BA94jalC9.COM 
c  *********************************************************************
c  *********************************************************************
c  **
c  ** Model IImac
c  ** Based on GCMII code for IBM RS/6000 computers created at GISS
c  ** Modified to compile under Absoft Pro Fortran 6.2 for MacOS.  
c  ** Based on MP008macC9, BA94C9 and MA94DC9
c  **
c  ** CHANGE HISTORY:
c  **
c  ** 07/27/99 First Successful Compile! (DCH)
c  ** 06/14/02 as original (MFS)
c  **
c  ** NOTES: 10/2002 Modernized by J.Lerner
c  **
c  *********************************************************************
c  *********************************************************************

C**** COMMON BLOCK (B35V)  FINE MODEL II DBLE.PREC. RS6000 10/29/91
C**** TO CHANGE THE GRID, MODIFY THE NEXT LINE ONLY
      PARAMETER (IM=36,JM=24,LM=9, KTD=6,KAIJ=80,KAJK=50)
C**** IM,JM,LM LIMITED TO 72,46,36 RESPECTIVELY BY RADCOM & SIGmas
      IMPLICIT REAL*8 (A-H,O-Z)
      REAL*8 LHE,LHM,LHS,KAPA,LAT,lat_dg
C**** THERE ARE 100 INTEGER PARAMETERS IN COMMON (JC-ARRAY)
      COMMON /IPARMB/IM0,JM0,LM0,JMM1,LMM1,   LS1,LTM,LBLM,LMCM,LSSM,
     *  KOCEAN,KDISK,KEYCT,KACC0,KCOPY,  IRAND,IJRA,MFILTR,NDYN,NCNDS,
     *  NRAD,NSURF,NGRND,NFILTR,NDAA,   NDA5D,NDA5K,NDA5S,NDA4,NDASF,
     *  MLAST,MDYN,MCNDS,MRAD,MSURF,    MDIAG,MELSE,MODRD,MODD5K,MODD5S,
     *  IYEAR,IDAY,IDAY0,JYEAR,JYEAR0,  JDAY,JDATE,JDATE0,NSTEP,MRCH,
     *  IDUM(4),NDZERO(13),NDPRNT(13),  IJD6(2,4),IDACC(12)
C**** THERE ARE 161 REAL NUMBERS IN COMMON (RC-ARRAY)
      COMMON /RPARMB/
     *  TAU,TAU0,TOFDAY,TOFDY0,DT,      TAUP,TAUI,TAUE,TAUT,TAUO,
     *  TWOPI,SDAY,LHE,LHM,LHS,         RADIUS,GRAV,RGAS,KAPA,OMEGA,
     *  CCMCX,ETA,S0X,CO2,SRCOR,        PTOP,PSF,PSL,PTRUNC,AREAG,
     *  XCDNST(2),XINT,DLAT,DLON,       SKIPSE,USESLP,USEP,USET,FIM,
     *  RSDIST,SIND,COSD,DOPK,SIG(36),SIGE(37),RDM2(44)
      CHARACTER*4 XLABEL,NAMD6,JMONTH,JMNTH0
      COMMON /TEXT/ XLABEL(33),NAMD6(4),JMONTH,JMNTH0
      COMMON /GEOMCB/ RAPVS(JM),RAPVN(JM),RAVPS(JM),RAVPN(JM),F(JM),
     *  DXYP(JM),DXP(JM),DYP(JM),DXYS(JM),SINP(JM),LAT(JM),
     *  DXYV(JM),DXV(JM),DYV(JM),DXYN(JM),COSP(JM),COSV(JM),lat_dg(jm,2)
      COMMON /BNDYCB/ FDATA(IM,JM,3),ODATA(IM,JM,5),GDATA(IM,JM,14),
     *  BLDATA(IM,JM,8),VDATA(IM,JM,10),
     *  Z1O(IM,JM),Z12O(IM,JM)
      COMMON /RADNCB/ RQT(IM,JM,3),SRHR(IM,JM,LM+1),TRHR(IM,JM,LM+1)
      COMMON /LAYACB/ DSIG(37),DSIGO(36)
      DIMENSION U(IM,JM,LM),V(IM,JM,LM),T(IM,JM,LM),P(IM,JM),Q(IM,JM,LM)
C**** DIAGNOSTIC ARRAYS
      PARAMETER (IMH=IM/2,     KACC=JM*80*3 + 24*80 +
     *   JM*3 + JM*LM*54 + JM*3*4 + IM*JM*KAIJ +
     *   IM*LM*16                      + 20*100 +
     *   JM*36 + (IMH+1)*20*8 + 8*2 + 24*50*4 +
     *   2*62*10*12 + JM*LM*KAJK + IM*JM*LM*6)
      COMMON/ACCUM/AJ(JM,80),BJ(JM,80),CJ(JM,80),DJ(24,80),
     *  APJ(JM,3),AJL(JM,LM,54),ASJL(JM,3,4),AIJ(IM,JM,KAIJ),
     *  AIL(IM,LM,16),ENERGY(20,100),
     *  CONSRV(JM,36),SPECA((IMH+1),20,8),ATPE(8,2),ADAILY(24,50,4),
     *  WAVE(2,62,10,12),AJK(JM,LM,KAJK),AIJK(IM,JM,LM,6),
     *  TSFREZ(IM,JM,2),TDIURN(IM,JM,KTD)
      COMMON/REGION/JREG(IM,JM)
      COMMON/KEYS/KEYNR(42,50),KDIAG(12)
sh-4.3$

Overall, this looks to me like it is defining the GRID layout, and with JM and IM and LM as the size values for various other arrays. I suspect LM is layers as we know MODEL II has 9 layers in the later version. That would make IM and JM the Lat and Long sizes. (nuber of boxes each way). Don’t know yet what the KTD and KA* set do, but Kxxx is often used for an INTEGER counter (COUNT being a real or float value not being between I and N…)

So mostly this looks like it sets up a bunch of arrays sized to the global grid for tracking input values and results. Any more depth can come from looking at the code that uses the variables.

The B83XXDBL.COM file

The next one looks like it is devoted to input parameters. Likely that stuff like where there is land and ice and water and vegetation and all… So this is the one I need to find a way to fill at start time. All those basic settings that were tuned to make it run “just so”.

sh-4.3$ cat B83XXDBL.COM 
c  *********************************************************************
c  *********************************************************************
c  **
c  ** Model IImac
c  ** Based on GCMII code for IBM RS/6000 computers created at GISS
c  ** Modified to compile under Absoft Pro Fortran 6.2 for MacOS.  
c  ** Based on MP008macC9, BA94C9 and MA94DC9
c  **
c  ** CHANGE HISTORY:
c  **
c  ** 07/27/99 First Successful Compile! (DCH)
c  ** 12/21/00
c  **
c  ** NOTES:
c  **
c  *********************************************************************
c  *********************************************************************


C                                                                       
C                   RADCOM:      CONTROL/INPUT PARAMETERS
C
      IMPLICIT REAL*8 (A-H,O-Z)
      COMMON/RADCOM/VADATA(11, 4, 3),DLAT(46),DLON(72),TAUMIN,FULGAS(18)
     A             ,FRACSL,RATQSL,FOGTSL,PTLISO,TLGRAD,TKCICE,FGOLDH(18)
     B             ,FLONO3,FRAYLE,FCLDTR,FCLDSR,FALGAE,FMARCL,FEMTRA(6)
     C             ,WETTRA,WETSRA,DMOICE,DMLICE,LICETK,NTRACE,FZASRA(6)
     D             ,ID5(5),ITR(4),IMG(2),ILG(2),LAPGAS,KWVCON,NORMS0,NV
     E             ,KEEPRH,KEEPAL,ISOSCT,IHGSCT,KGASSR,KAERSR,KFRACC
     F             ,MARCLD,LAYRAD,NL,NLP,JMLAT ,IMLON ,KFORCE,LASTVC
C
C                                BASIC RADCOM INPUT DATA
C
     G             ,PLB(40),HLB(40),TLB(40),TLT(40),TLM(40),U0GAS(40,9)
     H             ,ULGAS(40,9),TRACER(40,4),CLDTAU(40),SHL(40),RHL(40)
     I             ,POCEAN,PEARTH,POICE,PLICE,AGESN,SNOWE,SNOWOI,SNOWLI
     J             ,TGO,TGE,TGOI,TGLI,TSL,WMAG,WEARTH,ZOICE,FSPARE(200)
     K             ,S0,COSZ,PVT(11),BXA(153),SRBXAL(15,2),FRC(5),LUXGAS
     L             ,JYEAR,JDAY,JLAT,ILON,MEANAL,KALVIS,ISPARE(25),PSIG0
C
C                                BASIC RADCOM OUTPUT DATA
C
     M             ,TRDFLB(40),TRUFLB(40),TRNFLB(40),TRFCRL(40),TRSLCR
     N             ,SRDFLB(40),SRUFLB(40),SRNFLB(40),SRFHRL(40),SRSLHR
     O             ,SRIVIS,SROVIS,PLAVIS,SRINIR,SRONIR,PLANIR,SRXATM(4)
     P             ,SRDVIS,SRUVIS,ALBVIS,SRDNIR,SRUNIR,ALBNIR,FSRNFG(4)
     Q             ,SRTVIS,SRRVIS,SRAVIS,SRTNIR,SRRNIR,SRANIR,FTRUFG(4)
     R             ,TRDFGW,TRUFGW,TRUFTW,BTEMPW,TRDFSL,TRUFSL,DTRUFG(4)
     S             ,TRSLTS,TRSLTG,TRSLWV,TRSLBS,TTRUFG,LBOTCL,LTOPCL
C
C                                BLOCKD INITIALIZED DEFAULT DATA
C
      COMMON/BLOCKD/AGOLDH(11, 5),BGOLDH(11, 5),CGOLDH(11, 5)
     T             ,TRAQEX(25,11),TRAQSC(25,11),TRACOS(25,11)
     T             ,TRCQEX(25, 2),TRCQSC(25, 2),TRCCOS(25, 2)
     S             ,SRAQEX( 6,11),SRAQSC( 6,11),SRACOS( 6,11)
     S             ,SRCQEX( 6, 2),SRCQSC( 6, 2),SRCCOS( 6, 2)
     X             ,AOCEAN(25   ),AGSIDV(25, 4),CLDALB(25, 2)
     Y             ,CMANO2(42   ),TRACEG(25,16),PPMV58(9),Z0(9),ZH(9)
     Z             ,ASNALB(15),AOIALB(15),ALIALB(15),NAERO,NGOLDH,NKSR
C
      COMMON/WORK4/ ITLB(40),ITLT(40),PL(40),DPL(40),UO3L(40),PSIG(40)
     T           ,COSLAT(46),TRCALB(40),TRGALB(40),BGFEMT(40),BGFEMD(40)
     T             ,TRAEXT(40,25),TAUN(1000),TAUSL(25),FTAUSL(25)
     T             ,ENA(40),ENB(40),ENC(40),TRA(40),TRB(40),TRC(40)
     T             ,WTLB(40),WTLT(40)
     T             ,DFLB(40,25),UFLB(40,25),WFLB(40,25)
     T             ,DFSL(25),UFSL(25),WFSL(25)
     S             ,EXTAER(40,6),SCTAER(40,6),COSAER(40,6),PI0AER(40,6)
     S             ,RNB(40),RNX(40),TNB(40),TNX(40),XNB(40),XNX(40)
     S             ,SRB(40),SRX(40),VRU(40),VRD(40),FAC(40),O3A(40)
     S             ,BVSURF,BNSURF,XVSURF,XNSURF
     X             ,UXGAS(40,9),SRTAU(600)
C
C
      COMMON/TRDCOM/TRAX(40,25,5),TRCX(25,2),PLANCK(6250),TAUTBL(80000)
     A             ,TAULAP(1000),TKPFW(630)
     B             ,ITRHDR(100),MLGAS(30),MLLAP(30),NKTR,IT0,ITNEXT
     C             ,JNORTH,ALVISD(22),ALNIRD(22)
C$   D             ,ISRHDR(100),SRTBL(44800)
C

in Conclusion

OK, that’s enough for this one posting. The others will most likely get into the actual formulas and operations applied. There will be some kind of “load the data into the arrays” process, then a “stir the pot” and finally a “dump out the stew”, but at this point it is likely we have some clue about the goals and drivers of the program. It ASSUMES that FORCING will be via “Greenhouse Gasses” and that not much else is a driving parameter. Much of the rest will be ‘tuned’ values to let the GHG fantasy unfold as desired / expected.

Having read the Hansen paper about the model, that is much of what it says, reading between the lines. Things like “vegetation has to be like this or things are not right” and “temperatures were 15 degrees too high in the arctic until we tuned FOO”. More on that paper in a later posting too. (It is a PDF and quoting them can be a pain, so I put it off…)

For now, We’ve got a pretty good handle on the nature of the model.

Left to do?

-rw-r--r-- 1 chiefio chiefio 240095 Apr 17  2008 DB11pdC9.f
-rw-r--r-- 1 chiefio chiefio  13208 Aug  2  2005 FFT36macDBL.f
-rw-r--r-- 1 chiefio chiefio 204365 Mar 23  2006 Mjal2cpdC9.f
-rw-r--r-- 1 chiefio chiefio 331692 Jan 17  2006 Pjal0C9.f
-rw-r--r-- 1 chiefio chiefio 555793 Aug  2  2005 R83ZAmacDBL.f
-rw-r--r-- 1 chiefio chiefio 128314 Aug  2  2005 RFRCmacDBL.f

The FFT* program (that does a Fast Fourier Transform… I peeked ;-) and then 5 other large chunks. Each of them likely to take a whole posting just by themselves. They range from 1600 to just under 7000 lines each, so I’m unlikely to quote them in their entirety…

With that, I’m off for a cupp-a and some sofa time… ;-)

Subscribe to feed

Posted in AGW and GIStemp Issues, Tech Bits | Tagged , , , | 16 Comments