Changeset 3876


Ignore:
Timestamp:
Aug 1, 2025, 9:37:44 PM (30 hours ago)
Author:
emillour
Message:

Common dynamics:
Follow-up of r3874: Stopping the GCM if z2sig.def contains more lines
than expected for given llm is too strict. In some cases (Mars, Venus)
the same z2sig.def is used and "extra" layers for the thermosphere should
just be ignored when running a simulation limited to the troposphere.
While at it converted comments in disvert_noterre.F from French to
English.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3d_common/disvert_noterre.F

    r3874 r3876  
    33
    44c    Auteur :  F. Forget Y. Wanherdrick, P. Levan
    5 c    Nouvelle version 100% Mars !!
    6 c    On l'utilise aussi pour Venus et Titan, legerment modifiee.
    75
    86#ifdef CPP_IOIPSL
     
    2422c
    2523c=======================================================================
    26 c    Discretisation verticale en coordonn�e hybride (ou sigma)
    27 c
     24c    Vertical discretization for purely sigma or hybrid sigma-pressure
     25c    coordinate depending on user provided flag "hybrid"
    2826c=======================================================================
    2927c
     
    6260      write(lunout,*) trim(modname),': hybrid=',hybrid
    6361
    64 ! Ouverture possible de fichiers typiquement E.T.
     62! Open file esasig.def, or if not there open z2sig.def
    6563
    6664         open(99,file="esasig.def",status='old',form='formatted',
     
    7371
    7472c-----------------------------------------------------------------------
    75 c   cas 1 on lit les options dans esasig.def:
     73c   case 1 read from esasig.def:
    7674c   ----------------------------------------
    7775
     
    128126
    129127c-----------------------------------------------------------------------
    130 c   cas 2 on lit les options dans z2sig.def:
     128c   case 2 read from z2sig.def:
    131129c   ----------------------------------------
    132130
     
    147145         read(99,*,iostat=ierr1)
    148146         if (ierr1 .eq. 0) then
    149             write(lunout,*) 'ERROR: Expected nb of levels:', llm
    150             call abort_gcm(modname,
    151      &        'z2sig.def has more lines than expected', 1)
     147            write(lunout,*) 'WARNING: More lines in z2sig.def'
     148     &       //' than expected from nb of levels:', llm
     149!            call abort_gcm(modname,
     150!     &        'z2sig.def has more lines than expected', 1)
    152151         endif
    153152         CLOSE(99)
     
    178177 
    179178c-----------------------------------------------------------------------
    180 c    ....  Calculs  de ap(l) et de bp(l)  ....
     179c    ....  Compute  ap(l) and bp(l)  ....
    181180c    .........................................
    182181c
    183 c   .....  pa et preff sont lus  sur les fichiers start par dynetat0 .....
     182c   .....  note that pa and preff are from start file read by dynetat0
    184183c-----------------------------------------------------------------------
    185184c
     
    217216      write(lunout,*)  ap
    218217
    219 c     Calcul au milieu des couches :
    220 c     WARNING : le choix de placer le milieu des couches au niveau de
    221 c     pression interm�diaire est arbitraire et pourrait etre modifi�.
    222 c     Le calcul du niveau pour la derniere couche
    223 c     (on met la meme distance (en log pression)  entre P(llm)
    224 c     et P(llm -1) qu'entre P(llm-1) et P(llm-2) ) est
    225 c     Specifique.  Ce choix est sp�cifi� ici ET dans exner_milieu.F
     218c     Compute value at the mid-layer :
     219c     WARNING : there is an arbitrary decision here to put the
     220c     middle of the layer half-way (pressure-wise) between boundaries
     221c     In addition for the last layer (the top of which is at zero pressure)
     222c     P(llm), we choose to put it with the same interval (in log(pressure))
     223c     from P(llm-1), than there is between between P(llm-1) and P(llm-2)
     224c     This choice is quite specific and is done here AND in exner_milieu.F
     225c     Both routines should definitely use the same assumptions.
    226226
    227227      DO l = 1, llm-1
     
    282282
    283283
    284       RETURN
    285284      END
    286285
     
    292291c     esasig.def/z2sig.def lors du passage en coordonnees hybrides
    293292c     F. Forget 2002
    294 c     Connaissant sig (niveaux "sigma" ou on veut mettre les couches)
    295 c     L'objectif est de calculer newsig telle que
     293c     Knowing sig (the "sigma" levels where we want to put the layers)
     294c     The goal is to compute newsig such that
    296295c       (1 -pa/preff)*exp(1-1./newsig**2)+(pa/preff)*newsig = sig
    297 c     Cela ne se r�soud pas analytiquement:
    298 c     => on r�soud par iterration bourrine
     296c     Which cannot be done analyticaly:
     297c     => need for an iterative procedure
    299298c     ----------------------------------------------
    300 c     Information  : where exp(1-1./x**2) become << x
     299c     Information  : when exp(1-1./x**2) becomes << x
    301300c           x      exp(1-1./x**2) /x
    302301c           1           1
     
    308307c           0.269      1.E-5
    309308c           0.248      1.E-6
    310 c        => on peut utiliser newsig = sig*preff/pa si sig*preff/pa < 0.25
     309c        => one can thus use newsig = sig*preff/pa if sig*preff/pa < 0.25
    311310
    312311
     
    321320            newsig= sig
    322321      else if (sig*preff/pa.ge.0.25) then
    323         DO J=1,9999  ! nombre d''iteration max
     322        DO J=1,9999  ! overkill maximum number of iterations
    324323          F=((1 -pa/preff)*exp(1-1./newsig**2)+(pa/preff)*newsig)/sig
    325324c         write(0,*) J, ' newsig =', newsig, ' F= ', F
     
    331330              newsig=(X2+newsig)*0.5
    332331          end if
    333 c         Test : on arete lorsque on approxime sig � moins de 0.01 m pr�s
    334 c         (en pseudo altitude) :
     332c         Convergence is assumed if sig is within 0.01m (in pseudo-altitude)
     333c         of the target value.
    335334          IF(abs(10.*log(F)).LT.1.E-5) goto 999
    336335        END DO
     
    339338       end if
    340339 999   continue
    341        Return
     340
    342341      END
Note: See TracChangeset for help on using the changeset viewer.