Changeset 2651 for trunk/LMDZ.MARS


Ignore:
Timestamp:
Mar 28, 2022, 3:46:04 PM (3 years ago)
Author:
emillour
Message:

Mars GCM:

  • turn sugwd.F to sugwd.F90 with extra comments
  • turn yoegwd.h into a module

JL+EM

Location:
trunk/LMDZ.MARS
Files:
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r2646 r2651  
    36763676dedicated flag to avoid calls to mod() with a zero argument which causes
    36773677recent gfortran (9+) to complain about a division by zero when in debug mode.
     3678
     3679== 28/03/2022 == JL+EM
     3680- turn sugwd.F to sugwd.F90 with extra comments
     3681- turn yoegwd.h into a module
  • trunk/LMDZ.MARS/libf/phymars/gwprofil_mod.F90

    r2642 r2651  
    2929       
    3030      use dimradmars_mod, only: ndomainsz 
     31      use yoegwd_h, only: gkdrag, grcrit, gssec, gtsec
     32     
    3133      implicit none
    32 #include "yoegwd.h"   ! why begin with #, needs ask Ehouarn Millour
    3334 
    3435      ! 0. DECLARATIONS:
  • trunk/LMDZ.MARS/libf/phymars/gwstress_mod.F90

    r2642 r2651  
    2525
    2626      use dimradmars_mod, only: ndomainsz   
     27      use yoegwd_h, only: gkdrag, gtsec, gvcrit
     28
    2729      implicit none
    28       include "yoegwd.h"
    2930     
    3031      ! 0. DECLARATIONS:
  • trunk/LMDZ.MARS/libf/phymars/nonoro_gwd_ran_mod.F90

    r2641 r2651  
    5050     use xios_output_mod, only: send_xios_field
    5151#endif     
     52     
    5253      implicit none
    53       include "yoegwd.h"
    5454      include "callkeys.h"
    5555
  • trunk/LMDZ.MARS/libf/phymars/orodrag_mod.F90

    r2642 r2651  
    3838      USE gwprofil_mod, ONLY: gwprofil
    3939      USE comcstfi_h, ONLY: g, cpp
     40      USE yoegwd_h, ONLY: gkwake
    4041     
    4142      implicit none
    42       include "yoegwd.h"
    4343     
    4444      ! 0. DECLARATIONS:
  • trunk/LMDZ.MARS/libf/phymars/orosetup.F90

    r2642 r2651  
    2121      !-----------------------------------------------------------------------
    2222      use dimradmars_mod, only: ndomainsz
    23       USE comcstfi_h
     23      use comcstfi_h, only: cpp, g, r, pi
     24      use yoegwd_h, only: gfrcrit, grcrit, gsigcr, gssec, gtsec, gvsec
     25      use yoegwd_h, only: nktopg
     26     
    2427      implicit none
    25       include "yoegwd.h"
    2628     
    2729      ! 0. DECLARATIONS:
  • trunk/LMDZ.MARS/libf/phymars/sugwd.F90

    r2650 r2651  
    1       SUBROUTINE SUGWD(NLEV,PSIG)
    2 C     
    3 C**** *SUGWD* INITIALIZE COMMON YOEGWD CONTROLLING GRAVITY WAVE DRAG
    4 C     
    5 C     PURPOSE.
    6 C     --------
    7 C     INITIALIZE YOEGWD, THE COMMON THAT CONTROLS THE
    8 C     GRAVITY WAVE DRAG PARAMETRIZATION.
    9 C     
    10 C     EXPLICIT ARGUMENTS :
    11 C     --------------------
    12 C     
    13 C     INPUT :
    14 C     
    15 C     PSIG        : VERTICAL COORDINATE TABLE
    16 C     NLEV        : NUMBER OF MODEL LEVELS
    17 C     
    18 C     OUTPUT :
    19 C     
    20 C     NONE
    21 C     
    22 C     IMPLICIT ARGUMENTS :
    23 C     --------------------
    24 C     COMMON YOEGWD
    25 C     
    26 C     METHOD.
    27 C     -------
    28 C     SEE DOCUMENTATION
    29 C     
    30 C     EXTERNALS.
    31 C     ----------
    32 C     NONE
    33 C     
    34 C     REFERENCE.
    35 C     ----------
    36 C     ECMWF Research Department documentation of the IFS
    37 C     
    38 C     AUTHOR.
    39 C     -------
    40 C     MARTIN MILLER             *ECMWF*
    41 C     
    42 C     MODIFICATIONS.
    43 C     --------------
    44 C     ORIGINAL : 90-01-01
    45 C     ------------------------------------------------------------------
     1      SUBROUTINE SUGWD(nlayer,sigtest)
     2! ==============================================================================   
     3!     Initialize common variables in yoegwd.h to control the orographic
     4!     graivty wave drag parameterization. That means, all the tunable parameters
     5!     for oro-GW scheme are in this subroutine.
     6!     MARTIN MILLER             *ECMWF*               ORIGINAL : 90-01-01 
     7!     Update:    Jiandong Liu     2022/03/15          Rewirite into .F90 and
     8!                                                     comment.   
     9!     REFERENCE.
     10!     ----------
     11!     ECMWF Research Department documentation of the IFS
     12!===============================================================================
     13
     14      USE yoegwd_h, ONLY: GFRCRIT, GRCRIT, GVCRIT
     15      USE yoegwd_h, ONLY: GKDRAG, GKDRAGL, GHMAX
     16      USE yoegwd_h, ONLY: GRAHILO, GSIGCR, GSSEC
     17      USE yoegwd_h, ONLY: GTSEC, GVSEC, GKWAKE
     18      USE yoegwd_h, ONLY: NKTOPG
     19
    4620      implicit none
    47 C     
    48 C     -----------------------------------------------------------------
    49 c     !-*-      include 'yoegwd.h'
    50 #include "yoegwd.h"
    51 c     !-*-
    52 C     ----------------------------------------------------------------
    53 C     
    54       integer nlev
    55       REAL PSIG(NLEV+1)
    5621
    57       real zsigt,zpr,zpm1r
     22      ! 0.1 Inputs:         
     23      integer,intent(in):: nlayer                ! Number of model levels
     24      REAL,intent(in):: sigtest(nlayer+1)        ! Vertical coordinate table
     25
     26      ! 0.2 Outputs:
     27      ! None.
     28
     29      ! 0.3 Local variables
     30      real zsigt                ! Top of the sigma coordinates?
     31      real zpr                  ! Reference pressure ?
     32      real zpm1r                ! Pressure at full layer ?
    5833      integer jk
    59 C     
    60 C     *       1.    SET THE VALUES OF THE PARAMETERS
    61 C     --------------------------------
    62 C     
    63  100  CONTINUE
    64 C     
    65 c     PRINT *,' Dans sugwd nlev=',NLEV,' SIG=',PSIG
     34
     35!-------------------------------------------------------------------------------     
     36! 1.   Set the values of the parameters
     37!-------------------------------------------------------------------------------   
     38!     PRINT *,' Dans sugwd nlayer=',nlayer,' SIG=',sigtest
    6639      GHMAX=10000.
    67 C     
    68 c     old  ZSIGT=0.94
    69 c     old  ZPR=80000.
    70       ZSIGT=0.85
    71       ZPR=100000.
    72 C     
    73       DO 110 JK=1,NLEV-1
    74          ZPM1R=0.5*ZPR*(PSIG(JK)+PSIG(JK+1))
     40   
     41!     old  ZSIGT=0.94
     42!     old  ZPR=80000.
     43      ZSIGT=0.85      ! Sigmal levels
     44      ZPR=100000.     ! Surface (Reference) Pressure?
     45     
     46      ! ! Condition to find NKTOPG layer, which NKTOPG is a condition to set
     47      ! 1*pvar and 2*pvar layers (OROSETUP)
     48      DO JK=1,nlayer-1
     49         ZPM1R=0.5*ZPR*(sigtest(JK)+sigtest(JK+1))
    7550         IF((ZPM1R/ZPR).GE.ZSIGT)THEN
    76             NKTOPG=JK
     51            NKTOPG=JK   
    7752         ENDIF
    78  110  CONTINUE
     53      ENDDO
    7954      WRITE(*,*) 'In sugwd NKTOPG=',NKTOPG
    80 C     
    81       GSIGCR=0.80
    82 C     
    83       GKDRAG= 0.1  ! used to be 0.1 for mcd Version 1 and 2 (before 10/2000)
    84       GRCRIT=0.25
     55   
     56      GSIGCR=0.80  ! Sigmal levels to found the top of low level flow height (OROSETUP) 
     57      GKDRAG= 0.1  ! used to be 0.1 for mcd Version 1 and 2 (before 10/2000) (OROSETUP)
     58                     
    8559      GFRCRIT=1.0
    86       GKWAKE=1.0
    87 
    88 C     
     60      GKWAKE=1.0   ! The G in equation (16)
     61      GRCRIT=0.25  ! Critical value for Mean flow richardson number(OROSETUP)     
    8962      GKDRAGL=4.*GKDRAG
    9063      GRAHILO=1.
    91       GVCRIT =0.0
    92 C     
    93 C     
    94 C     ----------------------------------------------------------------
    95 C     
    96 C     *       2.    SET VALUES OF SECURITY PARAMETERS
    97 C     ---------------------------------
    98 C     
    99  200  CONTINUE
    100 C     
    101       GVSEC=0.10
    102       GSSEC=1.E-12
    103 C     
    104       GTSEC=1.E-07
    105 C     
    106 C     ----------------------------------------------------------------
    107 C     
     64      GVCRIT =0.0   
     65!------------------------------------------------------------------------------- 
     66! 2.    Set values of security parameters
     67!------------------------------------------------------------------------------- 
     68      GVSEC=0.10      ! Security values for For normal wind (pu^2+pv^2)^0.5(OROSETUP,GWSTRESS)
     69      GSSEC=1.E-12    ! Security values for Brunt–Väisälä frequency N^2 (OROSETUP)   
     70      GTSEC=1.E-07    ! Security values for Sub-grid scale anisotropy(OROSETUP,GWSTRESS)
     71
    10872      RETURN
    10973      END
  • trunk/LMDZ.MARS/libf/phymars/yoegwd_h.F90

    r2650 r2651  
     1module yoegwd_h
    12!     -----------------------------------------------------------------
    23!*    *COMMON* *YOEGWD* - PARAMETERS FOR GRAVITY WAVE DRAG CALCULATIONS
    34!     -----------------------------------------------------------------
    4 !
    5       real    ::  GFRCRIT,GRCRIT,GVCRIT,GKDRAG,GKDRAGL,GHMAX
    6       real    ::   GRAHILO,GSIGCR,GSSEC, GTSEC,  GVSEC, GKWAKE
    7       integer ::  NKTOPG
    8       COMMON/YOEGWD/ GFRCRIT,GRCRIT,GVCRIT,GKDRAG,GKDRAGL,GHMAX         &
    9      &             ,GRAHILO,GSIGCR,NKTOPG,GSSEC, GTSEC, GVSEC,GKWAKE
    10 !$OMP THREADPRIVATE(/YOEGWD/)
     5implicit none
    116
     7  real,save :: GFRCRIT
     8  real,save :: GRCRIT
     9  real,save :: GVCRIT
     10!$OMP THREADPRIVATE(GFRCRIT,GRCRIT,GVCRIT)
     11  real,save :: GKDRAG
     12  real,save :: GKDRAGL
     13  real,save :: GHMAX
     14!$OMP THREADPRIVATE(GKDRAG,GKDRAGL,GHMAX)
     15  real,save :: GRAHILO
     16  real,save :: GSIGCR
     17  real,save :: GSSEC
     18!$OMP THREADPRIVATE(GRAHILO,GSIGCR,GSSEC)
     19  real,save :: GTSEC
     20  real,save :: GVSEC
     21  real,save :: GKWAKE
     22!$OMP THREADPRIVATE(GTSEC,GVSEC,GKWAKE)
     23  integer ::  NKTOPG
     24!$OMP THREADPRIVATE(NKTOPG)
    1225
     26end module yoegwd_h
    1327
Note: See TracChangeset for help on using the changeset viewer.