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/libf/dyn3dpar
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.