Ignore:
Timestamp:
Aug 30, 2013, 11:28:18 AM (11 years ago)
Author:
emillour
Message:

Common dynamics: Minor correction in sortvarc.F (to handle cases when initial condition is generated via iniacademic) and addition of the possibility to run a given number of dynamical steps (ndynstep=...), as it is already implemented in the Mars GCM.
EM

Location:
trunk/LMDZ.COMMON/libf
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F

    r1021 r1022  
    162162      CALL getin('nday',nday)
    163163
     164      ! alternative to specifying nday (see also 'less1day' and 'fractday'
     165      ! options below: sopecify numbre of dynamic steps to run:
     166      ndynstep = -9999 ! default value ; if ndynstep <0 then option not used.
     167      call getin('ndynstep',ndynstep)
     168     
    164169!Config  Key  = starttime
    165170!Config  Desc = Heure de depart de la simulation
     
    900905      write(lunout,*)' anneeref = ', anneeref
    901906      write(lunout,*)' nday = ', nday
     907      if (ndynstep.ne.-9999) write(lunout,*)' ndynstep = ', ndynstep
     908      if (less1day) write(lunout,*)' fractday = ', fractday
    902909      write(lunout,*)' day_step = ', day_step
    903910      write(lunout,*)' iperiod = ', iperiod
  • trunk/LMDZ.COMMON/libf/dyn3d/control_mod.F90

    r492 r1022  
    2727  LOGICAL :: less1day   ! allows to run less than 1 day (for Venus)
    2828  REAL    :: fractday   ! fraction of the day to run in this case
     29 
     30  integer :: ndynstep ! Alternative to using less1day&fractday; user may
     31                      ! specify number of dynamical steps to run
    2932
    3033END MODULE
  • trunk/LMDZ.COMMON/libf/dyn3d/gcm.F

    r1019 r1022  
    2121      USE filtreg_mod
    2222      USE infotrac
    23       USE control_mod
     23      USE control_mod, only: planet_type,nday,day_step,iperiod,iphysiq,
     24     &                       raz_date,anneeref,starttime,dayref,
     25     &                       ok_dyn_ins,ok_dyn_ave,iecri,periodav,
     26     &                       less1day,fractday,ndynstep
    2427      use cpdet_mod, only: ini_cpdet
    2528
     
    496499c   ------------------------
    497500
    498 
    499       day_end = day_ini + nday
    500       WRITE(lunout,300)day_ini,day_end
    501  300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     501      day_end=day_ini+nday
     502      if (less1day) then
     503        day_end=day_ini+floor(time_0+fractday)
     504      endif
     505      if (ndynstep.gt.0) then
     506        day_end=day_ini+floor(time_0+float(ndynstep)/float(day_step))
     507      endif
     508     
     509      WRITE(lunout,'(a,i7,a,i7)')
     510     &             "run from day ",day_ini,"  to day",day_end
    502511
    503512#ifdef CPP_IOIPSL
  • trunk/LMDZ.COMMON/libf/dyn3d/leapfrog.F

    r1017 r1022  
    1515      USE guide_mod, ONLY : guide_main
    1616      USE write_field
    17       USE control_mod
     17      USE control_mod, only: planet_type,nday,day_step,iperiod,iphysiq,
     18     &                       less1day,fractday,ndynstep,iconser,
     19     &                       dissip_period,offline,ip_ebil_dyn,
     20     &                       ok_dynzon,periodav,ok_dyn_ave,iecri,
     21     &                       ok_dyn_ins,output_grads_dyn
    1822      use cpdet_mod, only: cpdet,tpot2t,t2tpot
    1923      use sponge_mod, only: callsponge,mode_sponge,sponge
     
    212216c MODIF VENUS: to run less than one day:
    213217        itaufin   = int(fractday*day_step)
     218      endif
     219      if (ndynstep.gt.0) then
     220        ! running a given number of dynamical steps
     221        itaufin=ndynstep
    214222      endif
    215223      itaufinp1 = itaufin +1
  • trunk/LMDZ.COMMON/libf/dyn3d/sortvarc.F

    r130 r1022  
    154154      END IF
    155155
    156       etot= etot/etot0
     156      ! compute relative changes in etot,... (except if 'reference' values
     157      ! are zero, which can happen when using iniacademic)
     158      if (etot0.ne.0) then
     159        etot= etot/etot0
     160      else
     161        etot=1.
     162      endif
    157163      rmsv= SQRT(rmsv/ptot)
    158       ptot= ptot/ptot0
    159       ztot= ztot/ztot0
    160       stot= stot/stot0
    161       ang = ang /ang0
     164      if (ptot0.ne.0) then
     165        ptot= ptot/ptot0
     166      else
     167        ptot=1.
     168      endif
     169      if (ztot0.ne.0) then
     170        ztot= ztot/ztot0
     171      else
     172        ztot=1.
     173      endif
     174      if (stot0.ne.0) then
     175        stot= stot/stot0
     176      else
     177        stot=1.
     178      endif
     179      if (ang0.ne.0) then
     180        ang = ang /ang0
     181      else
     182        ang=1.
     183      endif
    162184
    163185      firstcal = .false.
  • trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F

    r1021 r1022  
    189189      CALL getin('nday',nday)
    190190
     191      ! alternative to specifying nday (see also 'less1day' and 'fractday'
     192      ! options below: sopecify numbre of dynamic steps to run:
     193      ndynstep = -9999 ! default value ; if ndynstep <0 then option not used.
     194      call getin('ndynstep',ndynstep)
     195     
    191196!Config  Key  = starttime
    192197!Config  Desc = Heure de depart de la simulation
     
    956961      write(lunout,*)' anneeref = ', anneeref
    957962      write(lunout,*)' nday = ', nday
     963      if (ndynstep.ne.-9999) write(lunout,*)' ndynstep = ', ndynstep
     964      if (less1day) write(lunout,*)' fractday = ', fractday
    958965      write(lunout,*)' day_step = ', day_step
    959966      write(lunout,*)' iperiod = ', iperiod
  • trunk/LMDZ.COMMON/libf/dyn3dpar/control_mod.F90

    r492 r1022  
    2727  LOGICAL :: less1day   ! allows to run less than 1 day (for Venus)
    2828  REAL    :: fractday   ! fraction of the day to run in this case
     29 
     30  integer :: ndynstep ! Alternative to using less1day&fractday; user may
     31                      ! specify number of dynamical steps to run
    2932
    3033END MODULE
  • trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F

    r1019 r1022  
    2424      USE getparam
    2525      USE filtreg_mod
    26       USE control_mod
     26      USE control_mod, only: planet_type,nday,day_step,iperiod,iphysiq,
     27     &                       raz_date,anneeref,starttime,dayref,
     28     &                       ok_dyn_ins,ok_dyn_ave,iecri,periodav,
     29     &                       less1day,fractday,ndynstep
    2730      use cpdet_mod, only: ini_cpdet
    2831
     
    521524
    522525      day_end = day_ini + nday
    523       WRITE(lunout,300)day_ini,day_end
    524  300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     526      if (less1day) then
     527        day_end=day_ini+floor(time_0+fractday)
     528      endif
     529      if (ndynstep.gt.0) then
     530        day_end=day_ini+floor(time_0+float(ndynstep)/float(day_step))
     531      endif
     532     
     533      WRITE(lunout,'(a,i7,a,i7)')
     534     &             "run from day ",day_ini,"  to day",day_end
    525535
    526536#ifdef CPP_IOIPSL
  • trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F

    r1019 r1022  
    2020       USE guide_p_mod, ONLY : guide_main
    2121       USE getparam
    22        USE control_mod
     22       USE control_mod, only: planet_type,nday,day_step,iperiod,iphysiq,
     23     &                       less1day,fractday,ndynstep,iconser,
     24     &                       dissip_period,offline,ip_ebil_dyn,
     25     &                       ok_dynzon,periodav,ok_dyn_ave,iecri,
     26     &                       ok_dyn_ins,output_grads_dyn,
     27     &                       iapp_tracvl
    2328       use cpdet_mod, only: cpdet,tpot2t_glo_p,t2tpot_glo_p
    2429       use sponge_mod_p, only: callsponge,mode_sponge,sponge_p
     
    235240c MODIF VENUS: to run less than one day:
    236241        itaufin   = int(fractday*day_step)
     242      endif
     243      if (ndynstep.gt.0) then
     244        ! running a given number of dynamical steps
     245        itaufin=ndynstep
    237246      endif
    238247      itaufinp1 = itaufin +1
  • trunk/LMDZ.COMMON/libf/dyn3dpar/sortvarc.F

    r130 r1022  
    154154      END IF
    155155
    156       etot= etot/etot0
     156      ! compute relative changes in etot,... (except if 'reference' values
     157      ! are zero, which can happen when using iniacademic)
     158      if (etot0.ne.0) then
     159        etot= etot/etot0
     160      else
     161        etot=1.
     162      endif
    157163      rmsv= SQRT(rmsv/ptot)
    158       ptot= ptot/ptot0
    159       ztot= ztot/ztot0
    160       stot= stot/stot0
    161       ang = ang /ang0
     164      if (ptot0.ne.0) then
     165        ptot= ptot/ptot0
     166      else
     167        ptot=1.
     168      endif
     169      if (ztot0.ne.0) then
     170        ztot= ztot/ztot0
     171      else
     172        ztot=1.
     173      endif
     174      if (stot0.ne.0) then
     175        stot= stot/stot0
     176      else
     177        stot=1.
     178      endif
     179      if (ang0.ne.0) then
     180        ang = ang /ang0
     181      else
     182        ang=1.
     183      endif
    162184
    163185      firstcal = .false.
Note: See TracChangeset for help on using the changeset viewer.