Opened 14 years ago
Closed 14 years ago
#421 closed upgrade (Done)
Averages and diagnostics output files revisited — at Version 1
Reported by: | arango | Owned by: | arango |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.4 |
Component: | Nonlinear | Version: | 3.4 |
Keywords: | Cc: |
Description (last modified by )
The logic for writing time-averaged fields (AVERAGES) and diagnostic terms (DIAGNOSTICS_TS, DIAGNOSTICS_UV) into respective output NetCDF files was redesigned to provide more flexibility and facilitate expansion in the future.
- A new set of logical switches (T/F) Aout was added to control the time-averaged fields to write into output AVGNAME NetCDF file. These switches are set in standard input script, ocean.in:
! Logical switches (TRUE/FALSE) to activate writing of time-averaged ! fields into AVERAGE output file. Aout(idUvel) == T ! 3D U-velocity Aout(idVvel) == T ! 3D V-velocity Aout(idWvel) == T ! 3D W-velocity Aout(idOvel) == T ! omega vertical velocity Aout(idUbar) == T ! 2D U-velocity Aout(idVbar) == T ! 2D V-velocity Aout(idFsur) == T ! free-surface Aout(idTvar) == T T ! temperature and salinity Aout(idUsms) == T ! surface U-stress Aout(idVsms) == T ! surface V-stress Aout(idUbms) == T ! bottom U-stress Aout(idVbms) == T ! bottom V-stress Aout(idW2xx) == T ! 2D radiation stress, Sxx component Aout(idW2xy) == T ! 2D radiation stress, Sxy component Aout(idW2yy) == T ! 2D radiation stress, Syy component Aout(idU2rs) == T ! 2D radiation U-stress Aout(idV2rs) == T ! 2D radiation V-stress Aout(idU2Sd) == T ! 2D U-Stokes velocity Aout(idV2Sd) == T ! 2D V-Stokes velocity Aout(idW3xx) == T ! 3D radiation stress, Sxx component Aout(idW3xy) == T ! 3D radiation stress, Sxy component Aout(idW3yy) == T ! 3D radiation stress, Syy component Aout(idW3zx) == T ! 3D radiation stress, Szx component Aout(idW3zy) == T ! 3D radiation stress, Szy component Aout(idU3rs) == T ! 3D U-radiation stress Aout(idV3rs) == T ! 3D V-radiation stress Aout(idU3Sd) == T ! 3D U-Stokes velocity Aout(idV3Sd) == T ! 3D V-Stokes velocity Aout(idTsur) == T T ! surface net heat and salt flux Aout(idLhea) == T ! latent heat flux Aout(idShea) == T ! sensible heat flux Aout(idLrad) == T ! longwave radiation flux Aout(idSrad) == T ! shortwave radiation flux Aout(idevap) == T ! evaporation rate Aout(idrain) == T ! precipitation rate Aout(idDano) == T ! density anomaly Aout(idVvis) == T ! vertical viscosity Aout(idTdif) == T ! vertical T-diffusion Aout(idSdif) == T ! vertical Salinity diffusion Aout(idHsbl) == T ! depth of surface boundary layer Aout(idHbbl) == T ! depth of bottom boundary layer Aout(id2dRV) == T ! 2D relative vorticity Aout(id3dRV) == T ! 3D relative vorticity Aout(id2dPV) == T ! 2D potential vorticity Aout(id3dPV) == T ! 3D potential vorticity Aout(idu3dD) == T ! detided 3D U-velocity Aout(idv3dD) == T ! detided 3D V-velocity Aout(idu2dD) == T ! detided 2D U-velocity Aout(idv2dD) == T ! detided 2D V-velocity Aout(idFsuD) == T ! detided free-surface Aout(idTrcD) == T T ! detided temperature and salinity Aout(idHUav) == T ! u-volume flux, Huon Aout(idHVav) == T ! v-volume flux, Hvom Aout(idUUav) == T ! quadratic <u*u> term Aout(idUVav) == T ! quadratic <u*v> term Aout(idVVav) == T ! quadratic <v*v> term Aout(idU2av) == T ! quadratic <ubar*ubar> term Aout(idV2av) == T ! quadratic <vbar*vbar> term Aout(idZZav) == T ! quadratic <zeta*zeta> term Aout(idTTav) == T T ! quadratic <t*t> T/S terms Aout(idUTav) == T T ! quadratic <u*t> T/S terms Aout(idVTav) == T T ! quadratic <v*t> T/S terms Aout(iHUTav) == T T ! T/S volume flux, <Huon*t> Aout(iHVTav) == T T ! T/S volume flux, <Hvom*t> ! Logical switches (TRUE/FALSE) to activate writing of extra inert passive ! tracers other than biological and sediment tracers into the AVERAGE file. Aout(inert) == T ! inert passive tracers
- The strategy here is to provide the user with switches to control which variables are written into the AVGNAME output file. The time-averages require global arrays to hold the accumulated sums. This increases the memory requirements of the model. This update only allocates those fields that are requested. Otherwise, the pointer for the array in the AVERAGE(ng)%avg... structure remains unassociated and does not use memory. For example, in mod_average.F we now have:
IF (Aout(idFsur,ng)) THEN allocate ( AVERAGE(ng) % avgzeta(LBi:UBi,LBj:UBj) ) END IF
- Since we control the time-averaged fields with switches, there is not longer need for the following C-preprocessing options: AVERAGES_AKV, AVERAGES_AKS, AVERAGES_BEDLOAD, AVERAGES_FLUXES, AVERAGES_NEARSHORE, AVERAGES_QUADRATIC. These options are eliminated. The only option that is required to write any of these fields is AVERAGES. This is nice because we do not have to recompile, if such fields are needed.
- The routine set_avg_tile was completely redesigned to use these control swithes. Notice that arrays are no longer passed as arguments. This facilitates adding new fields in the future.
CALL set_avg_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & IminS, ImaxS, JminS, JmaxS, & # ifdef SOLVE3D & NOUT, & # endif & KOUT) ... IF (Aout(idFsur,ng)) THEN DO j=JstrR,JendR DO i=IstrR,IendR AVERAGE(ng)%avgzeta(i,j)=AVERAGE(ng)%avgzeta(i,j)+ & & OCEAN(ng)%zeta(i,j,Kout) END DO END DO END IF
- We still need the option AVERAGES_DETIDE to process time-averaged, detided fields. Notice that we also control the processing of these fields with the Aout switches. Also, I added the capability to detide temperature and salinity since we have better control of the memory requirements.
Aout(idu3dD) == T ! detided 3D U-velocity Aout(idv3dD) == T ! detided 3D V-velocity Aout(idu2dD) == T ! detided 2D U-velocity Aout(idv2dD) == T ! detided 2D V-velocity Aout(idFsuD) == T ! detided free-surface Aout(idTrcD) == T T ! detided temperature and salinity
- The time-averaged vorticity fields are moved from DIANAME to AVGNAME. This is a better place for such fields:
Aout(id2dRV) == T ! 2D relative vorticity Aout(id3dRV) == T ! 3D relative vorticity Aout(id2dPV) == T ! 2D potential vorticity Aout(id3dPV) == T ! 3D potential vorticity
- The private array Aout in several I/O and MPI communication routines routines was renamed to Awrk to avoid conflict with the Aout switches declared in mod_ncparam.F
- A new set of logical switches (T/F) Dout was added to control the time-averaged diagnostic terms to write into output DIANAME NetCDF file. These switches are set in standard input script, ocean.in:
! Logical switches (TRUE/FALSE) to activate writing of time-averaged, ! 2D momentum (ubar,vbar) diagnostic terms into DIAGNOSTIC output file. Dout(M2rate) == T ! acceleration Dout(M2pgrd) == T ! pressure gradient Dout(M2fcor) == T ! Coriolis force Dout(M2hadv) == T ! horizontal total advection Dout(M2xadv) == T ! horizontal XI-advection Dout(M2yadv) == T ! horizontal ETA-advection Dout(M2hrad) == T ! horizontal total radiation stress Dout(M2hvis) == T ! horizontal total viscosity Dout(M2xvis) == T ! horizontal XI-viscosity Dout(M2yvis) == T ! horizontal ETA-viscosity Dout(M2sstr) == T ! surface stress Dout(M2bstr) == T ! bottom stress ! Logical switches (TRUE/FALSE) to activate writing of time-averaged, ! 3D momentum (u,v) diagnostic terms into DIAGNOSTIC output file. Dout(M3rate) == T ! acceleration Dout(M3pgrd) == T ! pressure gradient Dout(M3fcor) == T ! Coriolis force Dout(M3hadv) == T ! horizontal total advection Dout(M3xadv) == T ! horizontal XI-advection Dout(M3yadv) == T ! horizontal ETA-advection Dout(M3vadv) == T ! vertival advection Dout(M3hrad) == T ! horizontal total radiation stress Dout(M3vrad) == T ! vertical radiation stress Dout(M3hvis) == T ! horizontal total viscosity Dout(M3xvis) == T ! horizontal XI-viscosity Dout(M3yvis) == T ! horizontal ETA-viscosity Dout(M3vvis) == T ! vertical viscosity ! Logical switches (TRUE/FALSE) to activate writing of time-averaged, ! active (temperature and salinity) and passive (inert) tracer diagnostic ! terms into DIAGNOSTIC output file: [1:NAT+NPT,Ngrids]. Dout(iTrate) == T T ! time rate of change Dout(iThadv) == T T ! horizontal total advection Dout(iTxadv) == T T ! horizontal XI-advection Dout(iTyadv) == T T ! horizontal ETA-advection Dout(iTvadv) == T T ! vertival advection Dout(iThdif) == T T ! horizontal total diffusion Dout(iTxdif) == T T ! horizontal XI-diffusion Dout(iTydif) == T T ! horizontal ETA-diffusion Dout(iTsdif) == T T ! horizontal S-diffusion Dout(iTvdif) == T T ! vertical diffusion
- Similar Aout and Dout switches are added to all the biology and sediment models input scripts. For example, in bio_Fennel.in now we have:
! Logical switches (TRUE/FALSE) to activate writing of time-averaged fields ! into AVERAGE output file: [1:NBT,Ngrids]. Aout(idTvar) == 12*T ! biological tracer ! Logical switches (TRUE/FALSE) to activate writing of time-averaged, ! biological tracer diagnostic terms into DIAGNOSTIC output file: ! [1:NBT,Ngrids]. Dout(iTrate) == 12*T ! time rate of change Dout(iThadv) == 12*T ! horizontal total advection Dout(iTxadv) == 12*T ! horizontal XI-advection Dout(iTyadv) == 12*T ! horizontal ETA-advection Dout(iTvadv) == 12*T ! vertival advection Dout(iThdif) == 12*T ! horizontal total diffusion Dout(iTxdif) == 12*T ! horizontal XI-diffusion Dout(iTydif) == 12*T ! horizontal ETA-diffusion Dout(iTsdif) == 12*T ! horizontal S-diffusion Dout(iTvdif) == 12*T ! vertical diffusion ! Logical switches (TRUE/FALSE) to activate writing of time-averaged, ! biological processes diagnostics terms into DIAGNOSTIC output file [Ngrids]. Dout(iCOfx) == T ! air-sea CO2 flux Dout(iDNIT) == T ! denitrification flux Dout(ipCO2) == T ! CO2 partial pressure Dout(iO2fx) == T ! air-sea O2 flux Dout(iPPro) == T ! primary production Dout(iNO3u) == T ! NO3 uptake
Notice that diagnostics activated with DIGNOSTICS_BIO in the Fennel's model are also controlled with the Dout instead of the Hout switch above. By the way, a bug was corrected when writing Dout(iPPro) and friends. They need to be scaled before writing in wrt_diag.F:
DO ivar=1,NDbio2d ifield=iDbio2(ivar) IF (Dout(ifield,ng)) THEN IF (ivar.eq.ipCO2) THEN scale=1.0_r8 ELSE scale=1.0_r8/(REAL(nDIA(ng),r8)*dtBIO) ! mmole m-2 day-1 END IF ... END IF END DO
WARNING:
- All the input ocean_*.in, bio_Fennel.in, ecosim.in, nemuro.in, npzd_Franks.in, npzd_Powell.in, npzd_iron.in, and sediment_*.in scripts were CHANGED in ROMS/External and User/External. Therefore, you need to update your particular application script so you can write these fields in output NetCDF files, with this and future version of the code when AVERAGES, AVERAGES_DETIDE, DIAGNOSTICS_TS, or DIAGNOSTICS_UV options are activated. I know that this may be inconvenient for you, but you are getting a lot of control now. Recall that all the standard input scripts are backward compatible with previous versions of the model. The routine inp_par.F will ignore all these new switches with old versions of the code.
- The file varinfo.dat was also modified to include the metadata for temp_tide, temp_detide, salt_tide, and salt_detide.
- If you added a biological model to ROMS, you need to upgrade your include file xxx_inp.h for inp_par.F. Use, for example, the file nemuro_inp.h for guideline.
Change History (1)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|---|
Resolution: | → Done |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.