Changeset 2239 for LMDZ5/trunk/libf


Ignore:
Timestamp:
Mar 23, 2015, 8:27:30 AM (9 years ago)
Author:
Ehouarn Millour
Message:

Reorganizing physics/dynamics interface:

  • what is related to dynamics-physics interface is now in a seperate directory: dynlmdz_phy* for physics in phy*
  • 1d model and related dependencies (including a couple from "dynamics", set up as symbolic links) is now in subdirectory "dyn1d" of phy*.
  • "bibio" directory is now "misc" and should only contain autonomous utilities.
  • "cosp" is now a subdirectory of phylmd.

EM

Location:
LMDZ5/trunk/libf
Files:
61 added
28 deleted
16 edited
10 copied
36 moved

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d/advtrac.F90

    r1987 r2239  
    7979
    8080  IF(iadvtr.EQ.0) THEN
    81      CALL initial0(ijp1llm,pbaruc)
    82      CALL initial0(ijmllm,pbarvc)
     81     pbaruc(:,:)=0
     82     pbarvc(:,:)=0
    8383  ENDIF
    8484
  • LMDZ5/trunk/libf/dyn3d/fluxstokenc.F

    r1907 r2239  
    8383
    8484      IF(iadvtr.EQ.0) THEN
    85          CALL initial0(ijp1llm,phic)
    86          CALL initial0(ijp1llm,tetac)
    87          CALL initial0(ijp1llm,pbaruc)
    88          CALL initial0(ijmllm,pbarvc)
     85         phic(:,:)=0
     86         tetac(:,:)=0
     87         pbaruc(:,:)=0
     88         pbarvc(:,:)=0
    8989      ENDIF
    9090
  • LMDZ5/trunk/libf/dyn3d/leapfrog.F

    r2221 r2239  
    437437#endif
    438438! #endif of #ifdef CPP_IOIPSL
     439#ifdef CPP_PHYS
    439440         CALL calfis( lafin , jD_cur, jH_cur,
    440441     $               ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,
    441442     $               du,dv,dteta,dq,
    442443     $               flxw,dufi,dvfi,dtetafi,dqfi,dpfi  )
    443 
     444#endif
    444445c      ajout des tendances physiques:
    445446c      ------------------------------
  • LMDZ5/trunk/libf/dyn3d_common/diagedyn.F

    r1952 r2239  
    5353c======================================================================
    5454 
     55      USE control_mod, ONLY : planet_type
     56     
    5557      IMPLICIT NONE
    5658C
     
    6062#include "iniprint.h"
    6163
    62 #ifdef CPP_EARTH
    63 #include "../phylmd/YOMCST.h"
    64 #include "../phylmd/YOETHF.h"
    65 #endif
     64!#ifdef CPP_EARTH
     65!#include "../phylmd/YOMCST.h"
     66!#include "../phylmd/YOETHF.h"
     67!#endif
     68! Ehouarn: for now set these parameters to what is in Earth physics...
     69!          (cf ../phylmd/suphel.h)
     70!          this should be generalized...
     71      REAL,PARAMETER :: RCPD=
     72     &               3.5*(1000.*(6.0221367E+23*1.380658E-23)/28.9644)
     73      REAL,PARAMETER :: RCPV=
     74     &               4.*(1000.*(6.0221367E+23*1.380658E-23)/18.0153)
     75      REAL,PARAMETER :: RCS=RCPV
     76      REAL,PARAMETER :: RCW=RCPV
     77      REAL,PARAMETER :: RLSTT=2.8345E+6
     78      REAL,PARAMETER :: RLVTT=2.5008E+6
     79!
    6680C
    6781      INTEGER imjmp1
     
    140154
    141155
    142 #ifdef CPP_EARTH
     156!#ifdef CPP_EARTH
     157      IF (planet_type=="earth") THEN
     158     
    143159c======================================================================
    144160C     Compute Kinetic enrgy
     
    314330      ec_pre (idiag)    = ec_tot
    315331C
    316 #else
    317       write(lunout,*)'diagedyn: Needs Earth physics to function'
    318 #endif
     332!#else
     333      ELSE
     334        write(lunout,*)'diagedyn: set to function with Earth parameters'
     335      ENDIF ! of if (planet_type=="earth")
     336!#endif
    319337! #endif of #ifdef CPP_EARTH
    320338      RETURN
  • LMDZ5/trunk/libf/dyn3dmem/call_calfis_mod.F90

    r2221 r2239  
    227227  !$OMP BARRIER
    228228
     229#ifdef CPP_PHYS
    229230    CALL calfis_loc(lafin ,jD_cur, jH_cur,                       &
    230231                     ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,   &
    231232                     du,dv,dteta,dq,                             &
    232233                     flxw, dufi,dvfi,dtetafi,dqfi,dpfi  )
    233 
     234#endif
    234235    ijb=ij_begin
    235236    ije=ij_end 
  • LMDZ5/trunk/libf/dyn3dmem/gcm.F

    r2230 r2239  
    1313      USE parallel_lmdz
    1414      USE infotrac
    15       USE mod_interface_dyn_phys
     15#ifdef CPP_PHYS
     16      USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
     17#endif
    1618      USE mod_hallo
    1719      USE Bands
  • LMDZ5/trunk/libf/dyn3dpar/advtrac_p.F90

    r1987 r2239  
    1010  !            M.A Filiberti (04/2002)
    1111  !
    12   USE parallel_lmdz
    13   USE Write_Field_p
    14   USE Bands
     12  USE parallel_lmdz, ONLY: ij_begin,ij_end,OMP_CHUNK,pole_nord,pole_sud,&
     13                           setdistrib
     14  USE Write_Field_p, ONLY: WriteField_p
     15  USE Bands, ONLY: jj_Nb_Caldyn,jj_Nb_vanleer
    1516  USE mod_hallo
    1617  USE Vampir
  • LMDZ5/trunk/libf/dyn3dpar/covcont_p.F

    r1907 r2239  
    11      SUBROUTINE covcont_p (klevel,ucov, vcov, ucont, vcont )
    2       USE parallel_lmdz
     2      USE parallel_lmdz, ONLY: ij_begin,ij_end,OMP_CHUNK,
     3     &                         pole_nord, pole_sud
    34      IMPLICIT NONE
    45
  • LMDZ5/trunk/libf/dyn3dpar/gcm.F

    r2225 r2239  
    1414      USE parallel_lmdz
    1515      USE infotrac
    16       USE mod_interface_dyn_phys
     16#ifdef CPP_PHYS
     17      USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
     18#endif
    1719      USE mod_hallo
    1820      USE Bands
  • LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F

    r2221 r2239  
    825825cc$OMP BARRIER
    826826!        CALL FTRACE_REGION_BEGIN("calfis")
     827#ifdef CPP_PHYS
    827828        CALL calfis_p(lafin ,jD_cur, jH_cur,
    828829     $               ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,
    829830     $               du,dv,dteta,dq,
    830831     $               flxw, dufi,dvfi,dtetafi,dqfi,dpfi  )
     832#endif
    831833!        CALL FTRACE_REGION_END("calfis")
    832834        ijb=ij_begin
  • LMDZ5/trunk/libf/dyn3dpar/mod_hallo.F90

    r1907 r2239  
    11module mod_Hallo
    2 USE parallel_lmdz
     2USE mod_const_mpi, ONLY: COMM_LMDZ,MPI_REAL_LMDZ
     3USE parallel_lmdz, ONLY: using_mpi, mpi_size, mpi_rank, omp_chunk, omp_rank, &
     4                         pole_nord, pole_sud, jj_begin, jj_end, &
     5                         jj_begin_para, jj_end_para
    36implicit none
    47  logical,save :: use_mpi_alloc
  • LMDZ5/trunk/libf/dyn3dpar/parallel_lmdz.F90

    r2054 r2239  
    3131    integer, save :: omp_size 
    3232!$OMP THREADPRIVATE(omp_rank)
     33
     34! Ehouarn: add "dummy variables" (which are in dyn3d_mem/parallel_lmdz.F90)
     35! so that calfis_loc compiles even if using dyn3dpar
     36    integer,save  :: jjb_u
     37    integer,save  :: jje_u
     38    integer,save  :: jjnb_u
     39    integer,save  :: jjb_v
     40    integer,save  :: jje_v
     41    integer,save  :: jjnb_v   
     42
     43    integer,save  :: ijb_u
     44    integer,save  :: ije_u
     45    integer,save  :: ijnb_u   
     46   
     47    integer,save  :: ijb_v
     48    integer,save  :: ije_v
     49    integer,save  :: ijnb_v   
    3350
    3451 contains
  • LMDZ5/trunk/libf/dynlmdz_phylmd/calfis_loc.F

    r2233 r2239  
    3636      USE IOPHY
    3737#endif
     38#ifdef CPP_PARA
    3839      USE parallel_lmdz,ONLY:omp_chunk,using_mpi,jjb_u,jje_u,jjb_v,jje_v
    3940      USE Write_Field
    4041      Use Write_field_p
    4142      USE Times
     43#endif
    4244      USE infotrac, ONLY: nqtot, niadv, tname
    4345      USE control_mod, ONLY: planet_type, nsplit_phys
    4446
     47#ifdef CPP_PARA
    4548      IMPLICIT NONE
    4649c=======================================================================
     
    11861189#endif
    11871190! of #ifdef CPP_PHYS
    1188       RETURN
     1191#endif
     1192! of #ifdef CPP_PARA
    11891193      END
  • LMDZ5/trunk/libf/dynlmdz_phylmd/calfis_p.F

    r2233 r2239  
    3333      USE IOPHY
    3434#endif
     35#ifdef CPP_PARA
    3536      USE parallel_lmdz, ONLY : omp_chunk, using_mpi
    3637      USE Write_Field
    3738      Use Write_field_p
    3839      USE Times
     40#endif
    3941      USE infotrac, ONLY: nqtot, niadv, tname
    4042      USE control_mod, ONLY: planet_type, nsplit_phys
     
    140142      REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s)
    141143
     144#ifdef CPP_PARA
    142145#ifdef CPP_PHYS
    143146! Ehouarn: for now calfis_p needs some informations from physics to compile
     
    11141117#endif
    11151118! of #ifdef CPP_PHYS
    1116       RETURN
     1119#endif
     1120! of #ifdef CPP_PARA
    11171121      END
  • LMDZ5/trunk/libf/dynlmdz_phylmd/gr_dyn_fi_p.F

    r2233 r2239  
    33!
    44      SUBROUTINE gr_dyn_fi_p(nfield,im,jm,ngrid,pdyn,pfi)
    5 #ifdef CPP_PHYS
     5#ifdef CPP_PARA
    66! Interface with parallel physics,
    77      USE mod_interface_dyn_phys
     
    4040c$OMP END DO NOWAIT
    4141#endif
    42 ! of #ifdef CPP_PHYS
     42! of #ifdef CPP_PARA
    4343      RETURN
    4444      END
  • LMDZ5/trunk/libf/dynlmdz_phylmd/gr_fi_dyn_p.F

    r2233 r2239  
    33!
    44      SUBROUTINE gr_fi_dyn_p(nfield,ngrid,im,jm,pfi,pdyn)
    5 #ifdef CPP_PHYS
     5#ifdef CPP_PARA
    66! Interface with parallel physics,
    77      USE mod_interface_dyn_phys
     
    5252c$OMP END DO NOWAIT
    5353#endif
    54 ! of #ifdef CPP_PHYS
     54! of #ifdef CPP_PARA
    5555      RETURN
    5656      END
  • LMDZ5/trunk/libf/dynlmdz_phylmd/iniphysiq.F90

    r2233 r2239  
    148148    WRITE (lunout, *) '  in the dynamics punjours=', punjours
    149149    WRITE (lunout, *) '   but in the physics RDAY=', rday
    150     IF (abs(rday-punjours)>0.01) THEN
     150    IF (abs(rday-punjours)>0.01*punjours) THEN
    151151        ! stop here if the relative difference is more than 1%
    152152      abort_message = 'length of day discrepancy'
     
    158158    WRITE (lunout, *) '     in the dynamics pg=', pg
    159159    WRITE (lunout, *) '  but in the physics RG=', rg
    160     IF (abs(rg-pg)>0.01) THEN
     160    IF (abs(rg-pg)>0.01*pg) THEN
    161161        ! stop here if the relative difference is more than 1%
    162162      abort_message = 'gravity discrepancy'
     
    168168    WRITE (lunout, *) '   in the dynamics prad=', prad
    169169    WRITE (lunout, *) '  but in the physics RA=', ra
    170     IF (abs(ra-prad)>0.01) THEN
     170    IF (abs(ra-prad)>0.01*prad) THEN
    171171        ! stop here if the relative difference is more than 1%
    172172      abort_message = 'planet radius discrepancy'
     
    178178    WRITE (lunout, *) '     in the dynamics pr=', pr
    179179    WRITE (lunout, *) '  but in the physics RD=', rd
    180     IF (abs(rd-pr)>0.01) THEN
     180    IF (abs(rd-pr)>0.01*pr) THEN
    181181        ! stop here if the relative difference is more than 1%
    182182      abort_message = 'reduced gas constant discrepancy'
     
    188188    WRITE (lunout, *) '     in the dynamics pcpp=', pcpp
    189189    WRITE (lunout, *) '  but in the physics RCPD=', rcpd
    190     IF (abs(rcpd-pcpp)>0.01) THEN
     190    IF (abs(rcpd-pcpp)>0.01*pcpp) THEN
    191191        ! stop here if the relative difference is more than 1%
    192192      abort_message = 'specific heat discrepancy'
  • LMDZ5/trunk/libf/dynlmdz_phylmd/mod_interface_dyn_phys.F90

    r2233 r2239  
    77 
    88 
    9 #ifdef CPP_PHYS
     9#ifdef CPP_PARA
    1010! Interface with parallel physics,
    1111CONTAINS
     
    5555  END SUBROUTINE Init_interface_dyn_phys
    5656#endif
    57 ! of #ifdef CPP_PHYS
     57! of #ifdef CPP_PARA
    5858END MODULE mod_interface_dyn_phys
  • LMDZ5/trunk/libf/dynlmdz_phymar/iniphysiq.F90

    r2238 r2239  
    2222                       rg, & ! gravity
    2323                       rcpp  ! specific heat of the atmosphere
    24   USE phyaqua_mod, ONLY: iniaqua
     24!  USE phyaqua_mod, ONLY: iniaqua
    2525  IMPLICIT NONE
    2626  !
     
    149149
    150150! Additional initializations for aquaplanets
    151 !$OMP PARALLEL
    152       if (iflag_phys>=100) then
    153         call iniaqua(klon_omp,rlatd,rlond,iflag_phys)
    154       endif
    155 !$OMP END PARALLEL
     151!!$OMP PARALLEL
     152!      if (iflag_phys>=100) then
     153!        call iniaqua(klon_omp,rlatd,rlond,iflag_phys)
     154!      endif
     155!!$OMP END PARALLEL
    156156
    157157      END
  • LMDZ5/trunk/libf/grid/dimension/makdim

    r2204 r2239  
    1212fi
    1313
    14 if (($1 % 8 != 0)) && (( $# = 3 ))
     14if (($1 % 8 != 0)) && (( $# == 3 ))
    1515then
    1616    echo "The number of longitudes must be a multiple of 8."
  • LMDZ5/trunk/libf/phylmd/dyn1d/1DUTILS.h

    r2238 r2239  
    1 #include "../dyn3d/conf_gcm.F90"
    2 #include "../dyn3d_common/q_sat.F"
     1#include "conf_gcm.F90"
     2#include "q_sat.F"
    33
    44!
     
    443443!   Declarations:
    444444!   -------------
    445 #include "dimensions.h"
    446 #include "comconst.h"
    447 #include "temps.h"
     445      include "dimensions.h"
     446      include "comconst.h"
     447      include "temps.h"
    448448!!#include "control.h"
    449 #include "logic.h"
    450 #include "netcdf.inc"
     449      include "logic.h"
     450      include "netcdf.inc"
    451451
    452452!   Arguments:
     
    587587!   Declarations:
    588588!   -------------
    589 #include "dimensions.h"
    590 #include "comconst.h"
    591 #include "temps.h"
     589      include "dimensions.h"
     590      include "comconst.h"
     591      include "temps.h"
    592592!!#include "control.h"
    593 #include "logic.h"
    594 #include "netcdf.inc"
     593      include "logic.h"
     594      include "netcdf.inc"
    595595
    596596!   Arguments:
     
    894894      IMPLICIT NONE
    895895 
    896 #include "dimensions.h"
    897 #include "paramet.h"
     896      include "dimensions.h"
     897      include "paramet.h"
    898898!
    899899!=======================================================================
  • LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90

    r2238 r2239  
    1 #ifdef CPP_1D
    2 #include "../dyn3d/mod_const_mpi.F90"
    3 #include "../dyn3d_common/control_mod.F90"
    4 #include "../dyn3d_common/infotrac.F90"
    5 #include "../dyn3d_common/disvert.F90"
     1!#ifdef CPP_1D
     2!#include "../dyn3d/mod_const_mpi.F90"
     3!#include "../dyn3d_common/control_mod.F90"
     4!#include "../dyn3d_common/infotrac.F90"
     5!#include "../dyn3d_common/disvert.F90"
    66
    77
     
    10521052#include "1Dconv.h"
    10531053
    1054 #endif
    1055 
     1054!#endif
     1055
  • LMDZ5/trunk/libf/phylmd/etat0_netcdf.F90

    r2227 r2239  
    55!
    66SUBROUTINE etat0_netcdf(ib, masque, phis, letat0)
     7#ifndef CPP_1D
    78!
    89!-------------------------------------------------------------------------------
     
    535536!#endif of #ifdef CPP_EARTH
    536537  RETURN
    537 
     538#endif
     539!#endif of ifndef CPP_1D
    538540END SUBROUTINE etat0_netcdf
    539541!
  • LMDZ5/trunk/libf/phylmd/init_phys_lmdz.F90

    r1907 r2239  
    33!
    44SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)
    5   USE mod_phys_lmdz_para
    6   USE mod_grid_phy_lmdz
     5  USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para, klon_omp
     6  USE mod_grid_phy_lmdz, ONLY: Init_grid_phy_lmdz, nbp_lev
    77  USE dimphy, ONLY : Init_dimphy
    88  USE infotrac, ONLY : type_trac
  • LMDZ5/trunk/libf/phylmd/limit_netcdf.F90

    r2159 r2239  
    44!
    55SUBROUTINE limit_netcdf(interbar, extrap, oldice, masque)
     6#ifndef CPP_1D
    67!
    78!-------------------------------------------------------------------------------
     
    660661! of #ifdef CPP_EARTH
    661662
     663#endif
     664! of #ifndef CPP_1D
    662665END SUBROUTINE limit_netcdf
Note: See TracChangeset for help on using the changeset viewer.