Changeset 1615 for LMDZ5


Ignore:
Timestamp:
Feb 10, 2012, 4:42:26 PM (13 years ago)
Author:
Ehouarn Millour
Message:

Introducing "phydev", the minimal physics package.
makegcm and makelmdz_fcm script have been updated to add CPP_PHYS preprocessing key when building with physics and CPP_EARTH for Earth (LMD physics) related routines or instructions in the dynamics.
Checked (on Vargas) that "dev" physics package compiles and runs well in all (seq/mpi/omp/mpi_omp) modes and that introduced changes do not modify results when using the "lmd" physics package.
EM + FH

Location:
LMDZ5/trunk
Files:
17 added
14 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d/calfis.F

    r1407 r1615  
    434434c
    435435      if (planet_type=="earth") then
    436 #ifdef CPP_EARTH
    437436cIM calcul PV a teta=350, 380, 405K
    438437      CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta,
    439438     $           ztfi,zplay,zplev,
    440439     $           ntetaSTD,rtetaSTD,PVteta)
    441 #endif
    442440      endif
    443441c
     
    450448
    451449
    452       if (planet_type=="earth") then
    453 #ifdef CPP_EARTH
    454450
    455451!      write(lunout,*) 'PHYSIQUE AVEC NSPLIT_PHYS=',nsplit_phys
     
    460456      zdqfic(:,:,:)=0.
    461457
    462       do isplit=1,nsplit_phys
     458      if (planet_type=="earth") then
     459#ifdef CPP_PHYS
     460
     461       do isplit=1,nsplit_phys
    463462
    464463         jH_cur_split=jH_cur+(isplit-1) * dtvr / (daysec *nsplit_phys)
     
    503502         zdqfic(:,:,:)=zdqfic(:,:,:)+zdqfi(:,:,:)
    504503
    505       enddo
     504       enddo ! of do isplit=1,nsplit_phys
     505
     506#endif
     507! of #ifdef CPP_PHYS
     508      endif ! of if (planet_type=="earth")
     509
    506510      zdufi(:,:)=zdufic(:,:)/nsplit_phys
    507511      zdvfi(:,:)=zdvfic(:,:)/nsplit_phys
     
    509513      zdqfi(:,:,:)=zdqfic(:,:,:)/nsplit_phys
    510514
    511 #endif
    512       endif !of if (planet_type=="earth")
    513515
    514516500   CONTINUE
  • LMDZ5/trunk/libf/dyn3d/ce0l.F90

    r1563 r1615  
    2828  IMPLICIT NONE
    2929#ifndef CPP_EARTH
     30#include "iniprint.h"
    3031  WRITE(lunout,*)'limit_netcdf: Earth-specific routine, needs Earth physics'
    3132#else
  • LMDZ5/trunk/libf/dyn3d/gcm.F

    r1592 r1615  
    2121! A nettoyer. On ne veut qu'une ou deux routines d'interface
    2222! dynamique -> physique pour l'initialisation
    23 ! Ehouarn: for now these only apply to Earth:
    24 #ifdef CPP_EARTH
     23#ifdef CPP_PHYS
    2524      USE dimphy
    2625      USE comgeomphy
     
    180179! A nettoyer. On ne veut qu'une ou deux routines d'interface
    181180! dynamique -> physique pour l'initialisation
    182 ! Ehouarn : temporarily (?) keep this only for Earth
    183       if (planet_type.eq."earth") then
    184 #ifdef CPP_EARTH
     181#ifdef CPP_PHYS
    185182      CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
    186183      call InitComgeomphy
    187184#endif
    188       endif
    189185!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    190186c-----------------------------------------------------------------------
     
    435431         WRITE(lunout,*)
    436432     .       'GCM: WARNING!!! vitesse verticale nulle dans la physique'
    437 ! Earth:
    438          if (planet_type.eq."earth") then
    439 #ifdef CPP_EARTH
     433! Physics:
     434#ifdef CPP_PHYS
    440435         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys ,
    441436     ,                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp     )
    442437#endif
    443          endif ! of if (planet_type.eq."earth")
    444438         call_iniphys=.false.
    445439      ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1))
    446 !#endif
    447440
    448441c  numero de stockage pour les fichiers de redemarrage:
     
    466459#endif
    467460
    468 #ifdef CPP_EARTH
     461#ifdef CPP_PHYS
    469462! Create start file (startphy.nc) and boundary conditions (limit.nc)
    470463! for the Earth verstion
  • LMDZ5/trunk/libf/dyn3d/leapfrog.F

    r1614 r1615  
    403403! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)!
    404404           IF (planet_type.eq."earth") THEN
     405#ifdef CPP_EARTH
    405406            CALL diagedyn(ztit,2,1,1,dtphys
    406407     &    , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     408#endif
    407409           ENDIF
    408410         ENDIF ! of IF (ip_ebil_dyn.ge.1 )
  • LMDZ5/trunk/libf/dyn3dpar/bands.F90

    r1279 r1615  
    9393   SUBROUTINE  Set_Bands
    9494     USE parallel
    95 #ifdef CPP_EARTH
    96 ! Ehouarn: what follows is only related to // physics; for now only for Earth
     95#ifdef CPP_PHYS
     96! Ehouarn: what follows is only related to // physics
    9797     USE mod_phys_lmdz_para, ONLY : jj_para_begin,jj_para_end
    9898#endif
     
    106106      enddo
    107107         
    108 #ifdef CPP_EARTH
    109 ! Ehouarn: what follows is only related to // physics; for now only for Earth         
     108#ifdef CPP_PHYS
    110109      do i=0,MPI_Size-1
    111110        jj_Nb_physic(i)=jj_para_end(i)-jj_para_begin(i)+1
     
    332331    subroutine AdjustBands_physic
    333332      use times
    334 #ifdef CPP_EARTH
    335 ! Ehouarn: what follows is only related to // physics; for now only for Earth
     333#ifdef CPP_PHYS
     334! Ehouarn: what follows is only related to // physics
    336335      USE mod_phys_lmdz_para, only : klon_mpi_para_nb
    337336#endif
     
    359358      medium=medium/mpi_size     
    360359      NbTot=0
    361 #ifdef CPP_EARTH
    362 ! Ehouarn: what follows is only related to // physics; for now only for Earth
     360#ifdef CPP_PHYS
    363361      do i=0,mpi_size-1
    364362        Inc(i)=nint(klon_mpi_para_nb(i)*(medium-value(i))/value(i))
  • LMDZ5/trunk/libf/dyn3dpar/calfis_p.F

    r1407 r1615  
    2727     $                  pdqfi,
    2828     $                  pdpsfi)
    29 #ifdef CPP_EARTH
    30 ! Ehouarn: For now, calfis_p needs Earth physics
    31 c
    32 c    Auteur :  P. Le Van, F. Hourdin
    33 c   .........
     29#ifdef CPP_PHYS
     30! If using physics
    3431      USE dimphy
    3532      USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root
     
    146143      REAL clesphy0( longcles )
    147144
    148 #ifdef CPP_EARTH
    149145c    Local variables :
    150146c    -----------------
     
    489485
    490486
    491       IF (is_sequential) THEN
    492 c
     487      IF (is_sequential.and.(planet_type=="earth")) THEN
    493488cIM calcul PV a teta=350, 380, 405K
    494489        CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta,
     
    627622c$OMP BARRIER
    628623     
    629       if (planet_type=="earth") then
    630 #ifdef CPP_EARTH
    631 
    632624!$OMP MASTER
    633625!      write(lunout,*) 'PHYSIQUE AVEC NSPLIT_PHYS=',nsplit_phys
     
    639631      zdqfic_omp(:,:,:)=0.
    640632
     633      if (planet_type=="earth") then
     634#ifdef CPP_PHYS
    641635      do isplit=1,nsplit_phys
    642636
     
    687681      enddo
    688682
     683#endif
     684! of #ifdef CPP_PHYS
     685      endif !of if (planet_type=="earth")
     686
    689687      zdufi_omp(:,:)=zdufic_omp(:,:)/nsplit_phys
    690688      zdvfi_omp(:,:)=zdvfic_omp(:,:)/nsplit_phys
    691689      zdtfi_omp(:,:)=zdtfic_omp(:,:)/nsplit_phys
    692690      zdqfi_omp(:,:,:)=zdqfic_omp(:,:,:)/nsplit_phys
    693 
    694 #endif
    695       endif !of if (planet_type=="earth")
    696691c$OMP BARRIER
    697692
     
    11101105      firstcal = .FALSE.
    11111106
    1112 #else
    1113       write(lunout,*)
    1114      & "calfis_p: for now can only work with parallel physics"
    1115       stop
    1116 #endif
    1117 ! of #ifdef CPP_EARTH
    11181107      RETURN
    11191108      END
  • LMDZ5/trunk/libf/dyn3dpar/ce0l.F90

    r1600 r1615  
    3131  IMPLICIT NONE
    3232#ifndef CPP_EARTH
     33#include "iniprint.h"
    3334  WRITE(lunout,*)'limit_netcdf: Earth-specific routine, needs Earth physics'
    3435#else
  • LMDZ5/trunk/libf/dyn3dpar/gcm.F

    r1592 r1615  
    2020      USE control_mod
    2121
    22 ! Ehouarn: for now these only apply to Earth:
    23 #ifdef CPP_EARTH
     22#ifdef CPP_PHYS
    2423      USE mod_grid_phy_lmdz
    2524      USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
     
    187186      call ini_getparam("out.def")
    188187      call Read_Distrib
    189 ! Ehouarn : temporarily (?) keep this only for Earth
    190       if (planet_type.eq."earth") then
    191 #ifdef CPP_EARTH
     188
     189#ifdef CPP_PHYS
    192190        CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
    193191#endif
    194       endif ! of if (planet_type.eq."earth")
    195192      CALL set_bands
    196 #ifdef CPP_EARTH
    197 ! Ehouarn: For now only Earth physics is parallel
     193#ifdef CPP_PHYS
    198194      CALL Init_interface_dyn_phys
    199195#endif
     
    207203c$OMP END PARALLEL
    208204
    209 ! Ehouarn : temporarily (?) keep this only for Earth
    210       if (planet_type.eq."earth") then
    211 #ifdef CPP_EARTH
     205#ifdef CPP_PHYS
    212206c$OMP PARALLEL
    213207      call InitComgeomphy
    214208c$OMP END PARALLEL
    215209#endif
    216       endif ! of if (planet_type.eq."earth")
    217210
    218211c-----------------------------------------------------------------------
     
    451444         WRITE(lunout,*)
    452445     .       'GCM: WARNING!!! vitesse verticale nulle dans la physique'
    453 ! Earth:
    454          if (planet_type.eq."earth") then
    455 #ifdef CPP_EARTH
     446! Physics:
     447#ifdef CPP_PHYS
    456448         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys ,
    457449     ,                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp     )
    458450#endif
    459          endif ! of if (planet_type.eq."earth")
    460451         call_iniphys=.false.
    461452      ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1))
     
    490481 301  FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)
    491482 302  FORMAT('1'/,15x,'    au ', i2,'/',i2,'/',i4)
     483#endif
     484
     485#ifdef CPP_PHYS
     486! Create start file (startphy.nc) and boundary conditions (limit.nc)
     487! for the Earth verstion
     488       if (iflag_phys>=100) then
     489          call iniaqua(ngridmx,latfi,lonfi,iflag_phys)
     490       endif
    492491#endif
    493492
  • LMDZ5/trunk/libf/dyn3dpar/gr_dyn_fi_p.F

    r1279 r1615  
    33!
    44      SUBROUTINE gr_dyn_fi_p(nfield,im,jm,ngrid,pdyn,pfi)
    5 #ifdef CPP_EARTH
     5#ifdef CPP_PHYS
    66! Interface with parallel physics,
    7 ! for now this routine only works with Earth physics
    87      USE mod_interface_dyn_phys
    98      USE dimphy
     
    4039      ENDDO
    4140c$OMP END DO NOWAIT
    42 #else
    43       write(lunout,*) "gr_fi_dyn_p : This routine should not be called",
    44      &   "without parallelized physics"
    45       stop
    4641#endif
    47 ! of #ifdef CPP_EARTH
     42! of #ifdef CPP_PHYS
    4843      RETURN
    4944      END
  • LMDZ5/trunk/libf/dyn3dpar/gr_fi_dyn_p.F

    r1279 r1615  
    33!
    44      SUBROUTINE gr_fi_dyn_p(nfield,ngrid,im,jm,pfi,pdyn)
    5 #ifdef CPP_EARTH
     5#ifdef CPP_PHYS
    66! Interface with parallel physics,
    7 ! for now this routine only works with Earth physics
    87      USE mod_interface_dyn_phys
    98      USE dimphy
     
    5251      ENDDO
    5352c$OMP END DO NOWAIT
    54 #else
    55       write(lunout,*) "gr_fi_dyn_p : This routine should not be called",
    56      &   "without parallelized physics"
    57       stop
    5853#endif
    59 ! of #ifdef CPP_EARTH
     54! of #ifdef CPP_PHYS
    6055      RETURN
    6156      END
  • LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F

    r1614 r1615  
    728728! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)!
    729729           IF (planet_type.eq."earth") THEN
     730#ifdef CPP_EARTH
    730731            CALL diagedyn(ztit,2,1,1,dtphys
    731732     &    , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     733#endif
    732734           ENDIF
    733735      ENDIF
  • LMDZ5/trunk/libf/dyn3dpar/mod_interface_dyn_phys.F90

    r1279 r1615  
    77 
    88 
    9 #ifdef CPP_EARTH
     9#ifdef CPP_PHYS
    1010! Interface with parallel physics,
    11 ! for now this routine only works with Earth physics
    1211CONTAINS
    1312 
     
    5655  END SUBROUTINE Init_interface_dyn_phys
    5756#endif
    58 ! of #ifdef CPP_EARTH
     57! of #ifdef CPP_PHYS
    5958END MODULE mod_interface_dyn_phys
  • LMDZ5/trunk/makegcm

    r1514 r1615  
    568568   set phys="L_PHY= LIBPHY="
    569569else
    570    #Default planet type is Earth
    571    set cppflags="$cppflags -DCPP_EARTH"
     570   #We'll use some physics
     571   set cppflags="$cppflags -DCPP_PHYS"
     572   if ( `echo $physique | grep -i "^lmd"` != "" ) then
     573     #For lmd physics, default planet type is Earth
     574     set cppflags="$cppflags -DCPP_EARTH"
     575   endif
    572576endif
    573577
  • LMDZ5/trunk/makelmdz_fcm

    r1578 r1615  
    190190if [[ "$physique" != "nophys" ]]
    191191then
    192    #Default planet type is Earth
     192   #We'll use some physics
     193   CPP_KEY="$CPP_KEY CPP_PHYS"
     194   if [[ "${physique:0:3}" == "lmd" ]]
     195   then
     196   #For lmd physics, default planet type is Earth
    193197   CPP_KEY="$CPP_KEY CPP_EARTH"
     198   fi
    194199fi
    195200
Note: See TracChangeset for help on using the changeset viewer.