Ignore:
Timestamp:
May 29, 2023, 12:41:48 PM (20 months ago)
Author:
emillour
Message:

Generic PCM:
Make number of scatterers fully dynamic (i.e. set in callphys.def
and no longer by compilation option "-s #").
One should now specify
naerkind = #
in callphys.def (default is 0).
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F

    r2785 r2972  
    2929      USE vertical_layers_mod, ONLY: init_vertical_layers
    3030      USE logic_mod, ONLY: hybrid
     31      use radinc_h, only: naerkind
    3132      use regular_lonlat_mod, only: init_regular_lonlat
    3233      use planete_mod, only: ini_planete_mod
     
    154155c INITIALISATION
    155156c=======================================================================
     157! check if 'rcm1d.def' file is around
     158      open(90,file='rcm1d.def',status='old',form='formatted',
     159     &     iostat=ierr)
     160      if (ierr.ne.0) then
     161        write(*,*) 'Cannot find required file "rcm1d.def"'
     162        write(*,*) 'which should contain some input parameters'
     163        write(*,*) ' ... might as well stop here ...'
     164        stop
     165      else
     166        close(90)
     167      endif
     168
     169! now, run.def is needed anyway. so we create a dummy temporary one
     170! for ioipsl to work. if a run.def is already here, stop the
     171! program and ask the user to do a bit of cleaning
     172      open(90,file='run.def',status='old',form='formatted',
     173     &     iostat=ierr)
     174      if (ierr.eq.0) then
     175        close(90)
     176        write(*,*) 'There is already a run.def file.'
     177        write(*,*) 'This is not compatible with 1D runs.'
     178        write(*,*) 'Please remove the file and restart the run.'
     179        write(*,*) 'Runtime parameters are supposed to be in rcm1d.def'
     180        stop
     181      else
     182        call system('touch run.def')
     183        call system("echo 'INCLUDEDEF=callphys.def' >> run.def")
     184        call system("echo 'INCLUDEDEF=rcm1d.def' >> run.def")
     185      endif
    156186
    157187      ! read nq from traceur.def
     
    187217      ! Initialize dimphy module
    188218      call init_dimphy(1,llm)
     219     
    189220      ! now initialize arrays using phys_state_var_init
     221      ! but first initialise naerkind (from callphys.def)
     222      naerkind=0 !default
     223      call getin("naerkind",naerkind)
     224     
    190225      call phys_state_var_init(nq)
    191226     
     
    221256c ------------------------------------------------------
    222257
    223 ! check if 'rcm1d.def' file is around
    224       open(90,file='rcm1d.def',status='old',form='formatted',
    225      &     iostat=ierr)
    226       if (ierr.ne.0) then
    227         write(*,*) 'Cannot find required file "rcm1d.def"'
    228         write(*,*) 'which should contain some input parameters'
    229         write(*,*) ' ... might as well stop here ...'
    230         stop
    231       else
    232         close(90)
    233       endif
    234 
    235 ! now, run.def is needed anyway. so we create a dummy temporary one
    236 ! for ioipsl to work. if a run.def is already here, stop the
    237 ! program and ask the user to do a bit of cleaning
    238       open(90,file='run.def',status='old',form='formatted',
    239      &     iostat=ierr)
    240       if (ierr.eq.0) then
    241         close(90)
    242         write(*,*) 'There is already a run.def file.'
    243         write(*,*) 'This is not compatible with 1D runs.'
    244         write(*,*) 'Please remove the file and restart the run.'
    245         write(*,*) 'Runtime parameters are supposed to be in rcm1d.def'
    246         stop
    247       else
    248         call system('touch run.def')
    249         call system("echo 'INCLUDEDEF=callphys.def' >> run.def")
    250         call system("echo 'INCLUDEDEF=rcm1d.def' >> run.def")
    251       endif
    252258
    253259! check if we are going to run with or without tracers
Note: See TracChangeset for help on using the changeset viewer.