Ignore:
Timestamp:
Mar 29, 2016, 11:45:49 AM (9 years ago)
Author:
emillour
Message:

All GCMS:
More updates to enforce dynamics/physics separation:

get rid of references to "temps_mod" from physics packages;
make a "time_phylmdz_mod.F90" module to store that
information and fill it via "iniphysiq".

EM

Location:
trunk/LMDZ.GENERIC/libf/phystd/dyn1d
Files:
1 deleted
1 edited

Legend:

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

    r1494 r1524  
    1919     &         obliquit,nres,z0,lmixmin,emin_turb,coefvis,coefir,
    2020     &         timeperi,e_elips,p_elips
    21       use comcstfi_mod, only: pi, cpp, daysec, dtphys, rad, g, r,
     21      use comcstfi_mod, only: pi, cpp, rad, g, r,
    2222     &                        mugaz, rcp, omeg
     23      use time_phylmdz_mod, only: daysec, dtphys
    2324      use callkeys_mod, only: tracer,check_cpp_match,rings_shadow,
    24      &          specOLR,water,pceil,ok_slab_ocean
     25     &                        specOLR,water,pceil,ok_slab_ocean
    2526      USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff
    2627      USE logic_mod, ONLY: hybrid,autozlevs
     28      use inifis_mod, only: inifis
    2729      implicit none
    2830
     
    130132      character*20,allocatable :: nametrac(:)   ! name of the tracer (no need for adv trac common)
    131133
    132       real :: latitude, longitude
     134      real :: latitude(1), longitude(1)
    133135
    134136c=======================================================================
     
    339341      longitude=longitude*pi/180.E+0
    340342
     343
     344!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     345!!!! PLANETARY CONSTANTS !!!!
     346!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     347
     348      g = -99999.
     349      PRINT *,'GRAVITY in m s-2 ?'
     350      call getin("g",g)
     351      IF (g.eq.-99999.) THEN
     352          PRINT *,"STOP. I NEED g IN RCM1D.DEF."
     353          STOP
     354      ELSE
     355          PRINT *,"--> g = ",g
     356      ENDIF
     357
     358      rad = -99999.
     359      PRINT *,'PLANETARY RADIUS in m ?'
     360      call getin("rad",rad)
     361      ! Planetary  radius is needed to compute shadow of the rings
     362      IF (rad.eq.-99999. .and. rings_shadow .eqv. .true.) THEN
     363          PRINT *,"STOP. I NEED rad IN RCM1D.DEF."
     364          STOP
     365      ELSE
     366          PRINT *,"--> rad = ",rad
     367      ENDIF
     368
     369      daysec = -99999.
     370      PRINT *,'LENGTH OF A DAY in s ?'
     371      call getin("daysec",daysec)
     372      IF (daysec.eq.-99999.) THEN
     373          PRINT *,"STOP. I NEED daysec IN RCM1D.DEF."
     374          STOP
     375      ELSE
     376          PRINT *,"--> daysec = ",daysec
     377      ENDIF
     378      omeg=4.*asin(1.)/(daysec)
     379      PRINT *,"OK. FROM THIS I WORKED OUT:"
     380      PRINT *,"--> omeg = ",omeg
     381
     382      year_day = -99999.
     383      PRINT *,'LENGTH OF A YEAR in days ?'
     384      call getin("year_day",year_day)
     385      IF (year_day.eq.-99999.) THEN
     386          PRINT *,"STOP. I NEED year_day IN RCM1D.DEF."
     387          STOP
     388      ELSE
     389          PRINT *,"--> year_day = ",year_day
     390      ENDIF
     391
     392      periastr = -99999.
     393      PRINT *,'MIN DIST STAR-PLANET in AU ?'
     394      call getin("periastr",periastr)
     395      IF (periastr.eq.-99999.) THEN
     396          PRINT *,"STOP. I NEED periastr IN RCM1D.DEF."
     397          STOP
     398      ELSE
     399          PRINT *,"--> periastr = ",periastr
     400      ENDIF
     401
     402      apoastr = -99999.
     403      PRINT *,'MAX DIST STAR-PLANET in AU ?'
     404      call getin("apoastr",apoastr)
     405      IF (apoastr.eq.-99999.) THEN
     406          PRINT *,"STOP. I NEED apoastr IN RCM1D.DEF."
     407          STOP
     408      ELSE
     409          PRINT *,"--> apoastr = ",apoastr
     410      ENDIF
     411
     412      peri_day = -99999.
     413      PRINT *,'DATE OF PERIASTRON in days ?'
     414      call getin("peri_day",peri_day)
     415      IF (peri_day.eq.-99999.) THEN
     416          PRINT *,"STOP. I NEED peri_day IN RCM1D.DEF."
     417          STOP
     418      ELSE IF (peri_day.gt.year_day) THEN
     419          PRINT *,"STOP. peri_day.gt.year_day"
     420          STOP
     421      ELSE 
     422          PRINT *,"--> peri_day = ", peri_day
     423      ENDIF
     424
     425      obliquit = -99999.
     426      PRINT *,'OBLIQUITY in deg ?'
     427      call getin("obliquit",obliquit)
     428      IF (obliquit.eq.-99999.) THEN
     429          PRINT *,"STOP. I NEED obliquit IN RCM1D.DEF."
     430          STOP
     431      ELSE
     432          PRINT *,"--> obliquit = ",obliquit
     433      ENDIF
     434
     435      psurf = -99999.
     436      PRINT *,'SURFACE PRESSURE in Pa ?'
     437      call getin("psurf",psurf)
     438      IF (psurf.eq.-99999.) THEN
     439          PRINT *,"STOP. I NEED psurf IN RCM1D.DEF."
     440          STOP
     441      ELSE
     442          PRINT *,"--> psurf = ",psurf
     443      ENDIF
     444      !! we need reference pressures
     445      pa=psurf/30.
     446      preff=psurf ! these values are not needed in 1D  (are you sure JL12)
     447
     448!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     449!!!! END PLANETARY CONSTANTS !!!!
     450!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     451
     452c  Date et heure locale du debut du run
     453c  ------------------------------------
     454c    Date (en sols depuis le solstice de printemps) du debut du run
     455      day0 = 0 ! default value for day0
     456      write(*,*) 'Initial date (in martian sols ; =0 at Ls=0)?'
     457      call getin("day0",day0)
     458      day=float(day0)
     459      write(*,*) " day0 = ",day0
     460c  Heure de demarrage
     461      time=0 ! default value for time
     462      write(*,*)'Initial local time (in hours, between 0 and 24)?'
     463      call getin("time",time)
     464      write(*,*)" time = ",time
     465      time=time/24.E+0 ! convert time (hours) to fraction of sol
     466
     467
     468c  Discretisation (Definition de la grille et des pas de temps)
     469c  --------------
     470c
     471      nlayer=llm
     472      nlevel=nlayer+1
     473      nsoil=nsoilmx
     474
     475      day_step=48 ! default value for day_step
     476      PRINT *,'Number of time steps per sol ?'
     477      call getin("day_step",day_step)
     478      write(*,*) " day_step = ",day_step
     479
     480       
     481      ecritphy=day_step ! default value for ecritphy
     482      PRINT *,'Nunber of steps between writediagfi ?'
     483      call getin("ecritphy",ecritphy)
     484      write(*,*) " ecritphy = ",ecritphy
     485
     486      ndt=10 ! default value for ndt
     487      PRINT *,'Number of sols to run ?'
     488      call getin("ndt",ndt)
     489      write(*,*) " ndt = ",ndt
     490
     491      ndt=ndt*day_step     
     492      dtphys=daysec/day_step 
     493      write(*,*)"-------------------------------------"
     494      write(*,*)"-------------------------------------"
     495      write(*,*)"--> Physical timestep is ",dtphys
     496      write(*,*)"-------------------------------------"
     497      write(*,*)"-------------------------------------"
     498
    341499!!! CALL INIFIS
    342500!!! - read callphys.def
     
    355513      r = 8.314511E+0 * 1000.E+0 / mugaz
    356514      rcp = r / cpp
    357 
    358 
    359 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    360 !!!! PLANETARY CONSTANTS !!!!
    361 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    362 
    363       g = -99999.
    364       PRINT *,'GRAVITY in m s-2 ?'
    365       call getin("g",g)
    366       IF (g.eq.-99999.) THEN
    367           PRINT *,"STOP. I NEED g IN RCM1D.DEF."
    368           STOP
    369       ELSE
    370           PRINT *,"--> g = ",g
    371       ENDIF
    372 
    373       rad = -99999.
    374       PRINT *,'PLANETARY RADIUS in m ?'
    375       call getin("rad",rad)
    376       ! Planetary  radius is needed to compute shadow of the rings
    377       IF (rad.eq.-99999. .and. rings_shadow .eqv. .true.) THEN
    378           PRINT *,"STOP. I NEED rad IN RCM1D.DEF."
    379           STOP
    380       ELSE
    381           PRINT *,"--> rad = ",rad
    382       ENDIF
    383 
    384       daysec = -99999.
    385       PRINT *,'LENGTH OF A DAY in s ?'
    386       call getin("daysec",daysec)
    387       IF (daysec.eq.-99999.) THEN
    388           PRINT *,"STOP. I NEED daysec IN RCM1D.DEF."
    389           STOP
    390       ELSE
    391           PRINT *,"--> daysec = ",daysec
    392       ENDIF
    393       omeg=4.*asin(1.)/(daysec)
    394       PRINT *,"OK. FROM THIS I WORKED OUT:"
    395       PRINT *,"--> omeg = ",omeg
    396 
    397       year_day = -99999.
    398       PRINT *,'LENGTH OF A YEAR in days ?'
    399       call getin("year_day",year_day)
    400       IF (year_day.eq.-99999.) THEN
    401           PRINT *,"STOP. I NEED year_day IN RCM1D.DEF."
    402           STOP
    403       ELSE
    404           PRINT *,"--> year_day = ",year_day
    405       ENDIF
    406 
    407       periastr = -99999.
    408       PRINT *,'MIN DIST STAR-PLANET in AU ?'
    409       call getin("periastr",periastr)
    410       IF (periastr.eq.-99999.) THEN
    411           PRINT *,"STOP. I NEED periastr IN RCM1D.DEF."
    412           STOP
    413       ELSE
    414           PRINT *,"--> periastr = ",periastr
    415       ENDIF
    416 
    417       apoastr = -99999.
    418       PRINT *,'MAX DIST STAR-PLANET in AU ?'
    419       call getin("apoastr",apoastr)
    420       IF (apoastr.eq.-99999.) THEN
    421           PRINT *,"STOP. I NEED apoastr IN RCM1D.DEF."
    422           STOP
    423       ELSE
    424           PRINT *,"--> apoastr = ",apoastr
    425       ENDIF
    426 
    427       peri_day = -99999.
    428       PRINT *,'DATE OF PERIASTRON in days ?'
    429       call getin("peri_day",peri_day)
    430       IF (peri_day.eq.-99999.) THEN
    431           PRINT *,"STOP. I NEED peri_day IN RCM1D.DEF."
    432           STOP
    433       ELSE IF (peri_day.gt.year_day) THEN
    434           PRINT *,"STOP. peri_day.gt.year_day"
    435           STOP
    436       ELSE 
    437           PRINT *,"--> peri_day = ", peri_day
    438       ENDIF
    439 
    440       obliquit = -99999.
    441       PRINT *,'OBLIQUITY in deg ?'
    442       call getin("obliquit",obliquit)
    443       IF (obliquit.eq.-99999.) THEN
    444           PRINT *,"STOP. I NEED obliquit IN RCM1D.DEF."
    445           STOP
    446       ELSE
    447           PRINT *,"--> obliquit = ",obliquit
    448       ENDIF
    449 
    450       psurf = -99999.
    451       PRINT *,'SURFACE PRESSURE in Pa ?'
    452       call getin("psurf",psurf)
    453       IF (psurf.eq.-99999.) THEN
    454           PRINT *,"STOP. I NEED psurf IN RCM1D.DEF."
    455           STOP
    456       ELSE
    457           PRINT *,"--> psurf = ",psurf
    458       ENDIF
    459       !! we need reference pressures
    460       pa=psurf/30.
    461       preff=psurf ! these values are not needed in 1D  (are you sure JL12)
    462 
    463 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    464 !!!! END PLANETARY CONSTANTS !!!!
    465 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    466 
    467 c  Date et heure locale du debut du run
    468 c  ------------------------------------
    469 c    Date (en sols depuis le solstice de printemps) du debut du run
    470       day0 = 0 ! default value for day0
    471       write(*,*) 'Initial date (in martian sols ; =0 at Ls=0)?'
    472       call getin("day0",day0)
    473       day=float(day0)
    474       write(*,*) " day0 = ",day0
    475 c  Heure de demarrage
    476       time=0 ! default value for time
    477       write(*,*)'Initial local time (in hours, between 0 and 24)?'
    478       call getin("time",time)
    479       write(*,*)" time = ",time
    480       time=time/24.E+0 ! convert time (hours) to fraction of sol
    481 
    482 
    483 c  Discretisation (Definition de la grille et des pas de temps)
    484 c  --------------
    485 c
    486       nlayer=llm
    487       nlevel=nlayer+1
    488       nsoil=nsoilmx
    489 
    490       day_step=48 ! default value for day_step
    491       PRINT *,'Number of time steps per sol ?'
    492       call getin("day_step",day_step)
    493       write(*,*) " day_step = ",day_step
    494 
    495        
    496       ecritphy=day_step ! default value for ecritphy
    497       PRINT *,'Nunber of steps between writediagfi ?'
    498       call getin("ecritphy",ecritphy)
    499       write(*,*) " ecritphy = ",ecritphy
    500 
    501       ndt=10 ! default value for ndt
    502       PRINT *,'Number of sols to run ?'
    503       call getin("ndt",ndt)
    504       write(*,*) " ndt = ",ndt
    505 
    506       ndt=ndt*day_step     
    507       dtphys=daysec/day_step 
    508       write(*,*)"-------------------------------------"
    509       write(*,*)"-------------------------------------"
    510       write(*,*)"--> Physical timestep is ",dtphys
    511       write(*,*)"-------------------------------------"
    512       write(*,*)"-------------------------------------"
    513515
    514516c output spectrum?
Note: See TracChangeset for help on using the changeset viewer.