Ignore:
Timestamp:
Jun 5, 2013, 2:41:09 PM (12 years ago)
Author:
emillour
Message:

Common dynamics:
Updates in the dynamics (seq and ) to keep up with updates
in LMDZ5 (up to LMDZ5 trunk, rev 1760):

  • General stuff (essentially to keep up with Earth model):
  • Updated makelmdz_fcm and makelmdz (more control on dimension.h, added option -mem, although it is not usefull for now)
  • Updated build_gcm with more control over fcm
  • Updated create_make_gcm (enable looking for code in subdirectories)
  • bibio:
  • updates (just renaming the files actually...) new_unit.F90 => new_unit_m.F90, pchsp_95.F90 => pchsp_95_m.F90 and pchfe_95.F90 => pchfe_95_m.F90
  • filtrez:
  • mod_fft.F90: use more baseline CPP directives for preprocessor compatibility
  • mod_filtre_fft_loc.F90: added this new file
  • filtreg_mod.f90: added calls to init_..._loc
  • filtreg.F: fixed calls to DGEMM into SGEMM (preprocessing does the switch)
  • dyn3d:
  • removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90

pres2lev.F90

  • added new file : pres2lev_mod.F90 (module containing "old" pres2lev)
  • gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip")
  • inidissip.F90: added arg "vert_prof_dissip" and the "earth model" discterizations (flagged with "planet_type=="earth")
  • comdissnew.h: added 'vert_prof_dissip' to the common block
  • guide_mod.F90: added the "use pres2lev_mod"
  • conf_gcm.F: cosmetics, and evaluation of vert_prof_dissip, (and also of dissip_* factors, for Earth model)
  • comconst.h : added dissip_factz,dissip_zref variables (for Earth mode dissip)
  • dyn3dpar:
  • removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90

pres2lev.F90 mod_const_para.F90

  • added new files: pres2lev_mod.F90 (module containing "old" pres2lev)

mod_const_mpi

  • abort_gcm : better control of abort in parallel mode
  • gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip")
  • inidissip.F90: added arg "vert_prof_dissip" and the "earth model" discterizations (flagged with "planet_type=="earth")
  • comdissnew.h: added 'vert_prof_dissip' to the common block
  • filtreg_p.F : bug correction (array bounds)
  • guide_p_mod.F90 : added the "use pres2lev_mod"
  • conf_gcm.F : cosmetics (and evaluation of vert_prof_dissip , and

also of dissip_* factors, for Earth model)
plus check if "adjust" is indeed not used in OpenMP

  • comconst.h : add dissip_factz,dissip_zref variables (for Earth mode dissip)

EM

Location:
trunk/LMDZ.COMMON/libf/dyn3dpar
Files:
2 added
4 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3dpar/abort_gcm.F

    r66 r979  
    11!
    2 ! $Id: abort_gcm.F 1475 2011-01-21 14:41:03Z emillour $
     2! $Id: abort_gcm.F 1748 2013-04-24 14:18:40Z emillour $
    33!
    44c
     
    2424
    2525      character(len=*) modname
    26       integer ierr
     26      integer ierr, ierror_mpi
    2727      character(len=*) message
    2828
     
    4747      else
    4848        write(lunout,*) 'Houston, we have a problem ', ierr
     49#ifdef CPP_MPI
     50C$OMP CRITICAL (MPI_ABORT_GCM)
     51        call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi)
     52C$OMP END CRITICAL (MPI_ABORT_GCM)
     53#else
    4954        stop 1
     55#endif         
    5056      endif
    5157      END
  • trunk/LMDZ.COMMON/libf/dyn3dpar/comconst.h

    r887 r979  
    2929      REAL g ! (m/s2) gravity
    3030      REAL omeg ! (rad/s) rotation rate of the planet
     31! Dissipation factors, for Earth model:
     32      REAL dissip_factz,dissip_zref !dissip_deltaz
     33! Dissipation factors, for other planets:
    3134      REAL dissip_fac_mid,dissip_fac_up,dissip_deltaz,dissip_hdelta
    3235      REAL dissip_pupstart
  • trunk/LMDZ.COMMON/libf/dyn3dpar/comdissnew.h

    r1 r979  
    1212
    1313      COMMON/comdissnew/ lstardis,nitergdiv,nitergrot,niterh,tetagdiv,  &
    14      &                   tetagrot,tetatemp,coefdis 
     14     &                   tetagrot,tetatemp,coefdis, vert_prof_dissip
    1515
    1616      LOGICAL lstardis
    1717      INTEGER nitergdiv, nitergrot, niterh
     18
     19! For the Earth model:
     20      integer vert_prof_dissip ! vertical profile of horizontal dissipation
     21!     Allowed values:
     22!     0: rational fraction, function of pressure
     23!     1: tanh of altitude
     24
    1825      REAL     tetagdiv, tetagrot,  tetatemp, coefdis
    1926
  • trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F

    r617 r979  
    1818      USE control_mod
    1919      USE infotrac, ONLY : type_trac
     20      use assert_m, only: assert
    2021      IMPLICIT NONE
    2122c-----------------------------------------------------------------------
     
    5455      LOGICAL  fxyhypbb, ysinuss
    5556      INTEGER i
    56      
     57      character(len=*),parameter :: modname="conf_gcm"
     58      character (len=80) :: abort_message
     59#ifdef CPP_OMP
     60      integer,external :: OMP_GET_NUM_THREADS
     61#endif     
    5762c
    5863c  -------------------------------------------------------------------
     
    8388c   initialisations:
    8489c   ----------------
    85       adjust=.false.
    86       call getin('adjust',adjust)
    87      
    88       itaumax=0
    89       call getin('itaumax',itaumax);
    90       if (itaumax<=0) itaumax=HUGE(itaumax)
    91      
     90
    9291!Config  Key  = lunout
    9392!Config  Desc = unite de fichier pour les impressions
     
    103102      ENDIF
    104103
     104      adjust=.false.
     105      call getin('adjust',adjust)
     106     
     107#ifdef CPP_OMP
     108      ! adjust=y not implemented in case of OpenMP threads...
     109!$OMP PARALLEL
     110      if ((OMP_GET_NUM_THREADS()>1).and.adjust) then
     111        write(lunout,*)'conf_gcm: Error, adjust should be set to n'
     112     &,' when running with OpenMP threads'
     113        abort_message = 'Wrong value for adjust'
     114        call abort_gcm(modname,abort_message,1)
     115      endif
     116!$OMP END PARALLEL         
     117#endif
     118
     119      itaumax=0
     120      call getin('itaumax',itaumax);
     121      if (itaumax<=0) itaumax=HUGE(itaumax)
     122     
    105123!Config  Key  = prt_level
    106124!Config  Desc = niveau d'impressions de débogage
     
    323341       CALL getin('tetatemp',tetatemp )
    324342
     343! For Earth model only:
     344! Parametres controlant la variation sur la verticale des constantes de
     345! dissipation.
     346! Pour le moment actifs uniquement dans la version a 39 niveaux
     347! avec ok_strato=y
     348
     349       dissip_factz=4.
     350       dissip_deltaz=10.
     351       dissip_zref=30.
     352       CALL getin('dissip_factz',dissip_factz )
     353       CALL getin('dissip_deltaz',dissip_deltaz )
     354       CALL getin('dissip_zref',dissip_zref )
     355
     356! For other planets:
    325357! Parametres controlant la variation sur la verticale des constantes de
    326358! dissipation.
     
    494526        write(lunout,*)"Le zoom en longitude est incompatible",
    495527     &                 " avec l'utilisation du filtre FFT ",
    496      &                 "---> filtre FFT désactivé "
     528     &                 "---> FFT filter not active"
    497529       use_filtre_fft=.FALSE.
    498530      ENDIF
     
    525557      ok_strato=.TRUE.
    526558      CALL getin('ok_strato',ok_strato)
     559
     560! NB: vert_prof_dissip is Earth-specific; should not impact other models
     561      if (planet_type=="earth") then
     562       vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39)
     563       CALL getin('vert_prof_dissip', vert_prof_dissip)
     564       call assert(vert_prof_dissip == 0 .or. vert_prof_dissip ==  1,
     565     $     "bad value for vert_prof_dissip")
     566      else
     567       vert_prof_dissip=0
     568      endif
    527569
    528570!Config  Key  = ok_gradsfile
     
    875917      write(lunout,*)' day_step = ', day_step
    876918      write(lunout,*)' iperiod = ', iperiod
     919      write(lunout,*)' nsplit_phys = ', nsplit_phys
    877920      write(lunout,*)' iconser = ', iconser
    878921      write(lunout,*)' iecri = ', iecri
  • trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F

    r965 r979  
    443443
    444444      CALL inidissip( lstardis, nitergdiv, nitergrot, niterh   ,
    445      *                tetagdiv, tetagrot , tetatemp              )
     445     *                tetagdiv, tetagrot , tetatemp, vert_prof_dissip)
    446446
    447447c-----------------------------------------------------------------------
  • trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90

    r776 r979  
    1111  USE getparam
    1212  USE Write_Field_p
    13   use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close
     13  USE netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close
     14  USE pres2lev_mod
    1415
    1516  IMPLICIT NONE
  • trunk/LMDZ.COMMON/libf/dyn3dpar/inidissip.F90

    r776 r979  
    33!
    44SUBROUTINE inidissip ( lstardis,nitergdiv,nitergrot,niterh  , &
    5      tetagdiv,tetagrot,tetatemp             )
     5     tetagdiv,tetagrot,tetatemp, vert_prof_dissip)
    66  !=======================================================================
    77  !   initialisation de la dissipation horizontale
     
    1111  !   -------------
    1212
    13   USE control_mod, only : dissip_period,iperiod
     13  USE control_mod, only : dissip_period,iperiod,planet_type
    1414
    1515  IMPLICIT NONE
     
    2626  REAL,INTENT(in) :: tetagdiv,tetagrot,tetatemp
    2727
     28  integer, INTENT(in):: vert_prof_dissip ! for the Earth model !!
     29  ! Vertical profile of horizontal dissipation
     30  ! Allowed values:
     31  ! 0: rational fraction, function of pressure
     32  ! 1: tanh of altitude
     33
    2834! Local variables:
    2935  REAL fact,zvert(llm),zz
     
    3541  INTEGER l,ij,idum,ii
    3642  REAL tetamin
     43  REAL pseudoz
    3744  REAL Pup
    3845  character (len=80) :: abort_message
     
    166173  !   variation verticale du coefficient de dissipation:
    167174  !   --------------------------------------------------
    168 
     175 
     176  if (planet_type.eq."earth") then
     177
     178   if (vert_prof_dissip == 1) then
     179     do l=1,llm
     180        pseudoz=8.*log(preff/presnivs(l))
     181        zvert(l)=1+ &
     182             (tanh((pseudoz-dissip_zref)/dissip_deltaz)+1.)/2. &
     183             *(dissip_factz-1.)
     184     enddo
     185   else
     186     DO l=1,llm
     187        zvert(l)=1.
     188     ENDDO
     189     fact=2.
     190     DO l = 1, llm
     191        zz      = 1. - preff/presnivs(l)
     192        zvert(l)= fact -( fact-1.)/( 1.+zz*zz )
     193     ENDDO
     194   endif ! of if (vert_prof_dissip == 1)
     195
     196  else ! other planets
     197 
    169198! First step: going from 1 to dissip_fac_mid (in gcm.def)
    170199!============
    171   DO l=1,llm
     200   DO l=1,llm
    172201     zz      = 1. - preff/presnivs(l)
    173202     zvert(l)= dissip_fac_mid -( dissip_fac_mid-1.)/( 1.+zz*zz )
    174   ENDDO
    175 
    176   write(lunout,*) 'Dissipation : '
    177   write(lunout,*) 'Multiplication de la dissipation en altitude :'
    178   write(lunout,*) '  dissip_fac_mid =', dissip_fac_mid
     203   ENDDO
     204
     205   write(lunout,*) 'Dissipation : '
     206   write(lunout,*) 'Multiplication de la dissipation en altitude :'
     207   write(lunout,*) '  dissip_fac_mid =', dissip_fac_mid
    179208
    180209! Second step if ok_strato:  from dissip_fac_mid to dissip_fac_up (in gcm.def)
     
    188217!   atmosphere par celui-ci.
    189218
    190   if (ok_strato) then
     219   if (ok_strato) then
    191220
    192221    Pup = dissip_pupstart*exp(-0.5*dissip_deltaz/dissip_hdelta)
     
    201230                   dissip_pupstart,'Pa', dissip_deltaz , '(km)'
    202231
    203   endif
     232   endif ! of if (ok_strato)
     233 
     234  endif ! of if (planet_type.eq."earth")
    204235
    205236
Note: See TracChangeset for help on using the changeset viewer.