Ignore:
Timestamp:
Apr 15, 2025, 9:34:31 AM (4 months ago)
Author:
emillour
Message:

Generic PCM:
Change the way the rate of outputs for diagfi.nc files is specified:
IMPORTANT: Specifying "ecritphy" no longer possible and will trigger an error.
Use "diagfi_output_rate" to specify output rate (in physics steps) instead.
This should makes things (hopefully) clearer for users and also better
enforces a cleaner and clearer separation between dynamics and physics.
EM

Location:
trunk/LMDZ.GENERIC/libf/aeronostd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/aeronostd/calchim_asis.F90

    r3312 r3725  
    1010      USE comcstfi_mod
    1111      use callkeys_mod
    12       use time_phylmdz_mod, only: ecritphy, iphysiq ! output rate set by ecritphy
     12      use time_phylmdz_mod, only: diagfi_output_rate ! output rate
    1313      use types_asis,       only: v_phot_3d, jlabel, nb_phot_hv_max
    1414      use chimiedata_h
     
    133133      integer :: iter(nlayer)      !  Number of chemical iterations
    134134                                   !  within one physical timestep
    135       integer :: icount
     135      integer,intent(in) :: icount ! physics iteration number
    136136!     for output:
    137137
     
    285285                        ig, zzlay, zzlev, zdens, zycol, ptimestep)
    286286            surface_flux2(ig,:) = surface_flux2(ig,:) + surface_flux(ig,:)
    287             if (ngrid==1) then
    288               if(mod(icount,ecritphy).eq.0) then
    289                 surface_flux2(ig,:) = surface_flux2(ig,:)/float(ecritphy)
    290               endif
    291             else
    292               if(mod(icount*iphysiq,ecritphy).eq.0) then
    293                 surface_flux2(ig,:) = surface_flux2(ig,:)*iphysiq/float(ecritphy)
    294               endif
     287            if(mod(icount,diagfi_output_rate).eq.0) then
     288              !note that surface_flux2(:,:) is reset every diagfi_output_rate
     289              surface_flux2(ig,:) = surface_flux2(ig,:)/float(diagfi_output_rate)
    295290            endif
    296          end if
     291         end if ! of if (depos)
    297292
    298293!=======================================================================
     
    405400            end do
    406401            ! Restart flux average
    407             if (ngrid == 1) then
    408                if(mod(icount,ecritphy).eq.0) then
    409                   surface_flux2(:,:) = 0.0
    410                endif
    411             else
    412                if(mod(icount*iphysiq,ecritphy).eq.0) then
    413                   surface_flux2(:,:) = 0.0
    414                endif
     402            if(mod(icount,diagfi_output_rate).eq.0) then
     403              surface_flux2(:,:) = 0.0
    415404            endif
    416405         endif ! end depos
     
    424413
    425414      end if ! of if (output)
    426 
    427       return
    428415
    429416
  • trunk/LMDZ.GENERIC/libf/aeronostd/writediagspecUV.F

    r3309 r3725  
    3030     &                              nbp_lon, nbp_lat, grid_type,
    3131     &                              unstructured
    32       use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
     32      use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
     33      use time_phylmdz_mod, only: day_ini
    3334
    3435      implicit none
     
    4849!      real dx0
    4950
    50       integer irythme
     51      integer isample
    5152      integer ierr
    5253      integer iq
     
    8788!output frequency
    8889
    89       irythme = ecritphy ! output with ecritphy frequency
    90 !EM+JL if the spetra need to be output more frequently, need to define a ecritSpec...
    91 !     irythme = iphysiq  ! sortie a tous les pas physique
     90      isample = diagfi_output_rate ! output with ecritphy frequency
     91!EM+JL if the spectra need to be output more frequently, need to define a
     92! diagspec_output_rate...
    9293
    9394!***************************************************************
     
    173174!------------------------------------------------------------------------
    174175      if (nom.eq.firstnom) then
    175           zitau = zitau + iphysiq
     176          zitau = zitau + 1
    176177      end if
    177178
     
    180181!--------------------------------------------------------
    181182
    182       if ( MOD(zitau+1,irythme) .eq.0.) then
     183      if ( MOD(zitau+1,isample) .eq.0.) then
    183184
    184185! Compute/write/extend 'Time' coordinate (date given in days)
     
    193194           ntime=ntime+1 ! increment # of stored time steps
    194195           ! compute corresponding date (in days and fractions thereof)
    195            date= float (zitau +1)/float (day_step)
     196           date=(zitau +1)*(dtphys/daysec)
    196197
    197198           if (is_master) then
     
    313314        endif ! of if (dimpx.eq.3)
    314315
    315       endif ! of if ( MOD(zitau+1,irythme) .eq.0.)
     316      endif ! of if ( MOD(zitau+1,isample) .eq.0.)
    316317
    317318      ! Close the NetCDF file
Note: See TracChangeset for help on using the changeset viewer.