Ignore:
Timestamp:
Jul 25, 2016, 11:31:56 AM (8 years ago)
Author:
Ehouarn Millour
Message:

Cleanup in the dynamics: turn logic.h into module logic_mod.F90
EM

Location:
LMDZ5/trunk/libf/dyn3dpar
Files:
28 edited
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3dpar/advect_new_p.F

    r2600 r2603  
    77      USE write_field_p
    88      USE comconst_mod, ONLY: daysec
     9      USE logic_mod, ONLY: conser
     10     
    911      IMPLICIT NONE
    1012c=======================================================================
     
    3032#include "paramet.h"
    3133#include "comgeom.h"
    32 #include "logic.h"
    3334#include "ener.h"
    3435
     
    116117                 
    117118           uav(ij,l)=0.25*(ucov(ij,l)+ucov(ij-iip1,l))
    118      .               +0.25*(ucov(ij+iip1,l)+ucov(ij,l))
     119     .                     +0.25*(ucov(ij+iip1,l)+ucov(ij,l))
    119120         ENDDO
    120121         
     
    249250      DO l=1,llm
    250251        DO ij=ijb,ije-1
    251           du(ij,l)=du(ij,l)+du2(ij,l)-du1(ij,l)
    252         ENDDO
     252          du(ij,l)=du(ij,l)+du2(ij,l)-du1(ij,l)
     253        ENDDO
    253254
    254255        DO   ij   = ijb+iip1-1, ije, iip1
     
    265266      DO l=1,llm
    266267        DO ij=ijb,ije
    267           dv(ij,l)=dv(ij,l)+dv2(ij,l)-dv1(ij,l)
    268         ENDDO
     268          dv(ij,l)=dv(ij,l)+dv2(ij,l)-dv1(ij,l)
     269        ENDDO
    269270      ENDDO
    270271c$OMP END DO NOWAIT     
     
    275276      DO l=1,llm
    276277        DO ij=ijb,ije
    277           dteta(ij,l)=dteta(ij,l)+dteta2(ij,l)-dteta1(ij,l)
    278         ENDDO
     278          dteta(ij,l)=dteta(ij,l)+dteta2(ij,l)-dteta1(ij,l)
     279        ENDDO
    279280      ENDDO
    280281c$OMP END DO NOWAIT     
  • LMDZ5/trunk/libf/dyn3dpar/advect_p.F

    r2600 r2603  
    66      USE write_field_p
    77      USE comconst_mod, ONLY: daysec
     8      USE logic_mod, ONLY: conser
     9     
    810      IMPLICIT NONE
    911c=======================================================================
     
    2931#include "paramet.h"
    3032#include "comgeom.h"
    31 #include "logic.h"
    3233#include "ener.h"
    3334
  • LMDZ5/trunk/libf/dyn3dpar/advtrac_p.F90

    r2601 r2603  
    2626  include "comdissip.h"
    2727  include "comgeom2.h"
    28   include "logic.h"
    2928  include "ener.h"
    3029  include "description.h"
  • LMDZ5/trunk/libf/dyn3dpar/bernoui_p.F

    r1907 r2603  
    2525#include "dimensions.h"
    2626#include "paramet.h"
    27 #include "logic.h"
    2827c
    2928c   Arguments:
  • LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F90

    r2601 r2603  
    1919                          iflag_top_bound, mode_top_bound, tau_top_bound, &
    2020                          ngroup
     21  USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, &
     22                       ok_guide, ok_limit, ok_strato, purmats, read_start, &
     23                       ysinus
    2124  USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
    2225                       alphax,alphay,taux,tauy
     
    4043  include "dimensions.h"
    4144  include "paramet.h"
    42   include "logic.h"
    4345  include "comdissnew.h"
    4446  include "iniprint.h"
  • LMDZ5/trunk/libf/dyn3dpar/convmas1_p.F

    r2600 r2603  
    3232#include "dimensions.h"
    3333#include "paramet.h"
    34 #include "logic.h"
    3534
    3635      REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
  • LMDZ5/trunk/libf/dyn3dpar/convmas2_p.F

    r2600 r2603  
    3232#include "dimensions.h"
    3333#include "paramet.h"
    34 #include "logic.h"
    3534
    3635      REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
  • LMDZ5/trunk/libf/dyn3dpar/convmas_p.F

    r2600 r2603  
    3232#include "dimensions.h"
    3333#include "paramet.h"
    34 #include "logic.h"
    3534
    3635      REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
  • LMDZ5/trunk/libf/dyn3dpar/divgrad_p.F

    r1907 r2603  
    2323#include "comgeom.h"
    2424#include "comdissipn.h"
    25 #include "logic.h"
    2625c
    2726      INTEGER klevel
  • LMDZ5/trunk/libf/dyn3dpar/dteta1_p.F

    r1907 r2603  
    2222#include "dimensions.h"
    2323#include "paramet.h"
    24 #include "logic.h"
    2524
    2625      REAL teta( ip1jmp1,llm ),pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm)
  • LMDZ5/trunk/libf/dyn3dpar/dynetat0.F

    r2601 r2603  
    1212      USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa,
    1313     &                        lllm, omeg, rad
    14 
     14      USE logic_mod, ONLY: fxyhypb, ysinus
    1515      USE serre_mod, ONLY: clon,clat,grossismx,grossismy
    1616      USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn,
     
    4040#include "netcdf.inc"
    4141#include "description.h"
    42 #include "logic.h"
    4342#include "iniprint.h"
    4443
  • LMDZ5/trunk/libf/dyn3dpar/dynredem.F

    r2601 r2603  
    1212     &                        nivsig,nivsigs
    1313      USE comconst_mod, ONLY: cpp, daysec, dtvr, g, kappa, omeg, rad
     14      USE logic_mod, ONLY: fxyhypb, ysinus
    1415      USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,
    1516     &                     taux,tauy
     
    2728#include "comgeom2.h"
    2829#include "ener.h"
    29 #include "logic.h"
    3030#include "netcdf.inc"
    3131#include "description.h"
  • LMDZ5/trunk/libf/dyn3dpar/dynredem_p.F

    r2601 r2603  
    1313     &                        nivsig,nivsigs
    1414      USE comconst_mod, ONLY: cpp, daysec, dtvr, g, kappa, omeg, rad
     15      USE logic_mod, ONLY: fxyhypb, ysinus
    1516      USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,
    1617     &                     taux,tauy
     
    2829#include "comgeom2.h"
    2930#include "ener.h"
    30 #include "logic.h"
    3131#include "netcdf.inc"
    3232#include "description.h"
  • LMDZ5/trunk/libf/dyn3dpar/gcm.F

    r2601 r2603  
    3333#endif
    3434      USE comconst_mod, ONLY: cpp, daysec, dtphys, dtvr, g, r, rad
     35      USE logic_mod ! all of it, because of copyin clause when calling leapfrog
    3536      USE temps_mod, ONLY: calend,start_time,annee_ref,day_ref,
    3637     &                itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end,
     
    7273#include "comdissnew.h"
    7374#include "comgeom.h"
    74 #include "logic.h"
    7575#include "ener.h"
    7676#include "description.h"
     
    501501
    502502!c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/)
    503 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/logici/,/logicl/)
     503c$OMP PARALLEL DEFAULT(SHARED)
    504504c        Copy all threadprivate variables from temps_mod
    505505c$OMP1 COPYIN(dt,jD_ref,jH_ref,start_time,hour_ini,day_ini,day_end)
    506506c$OMP1 COPYIN(annee_ref,day_ref,itau_dyn,itau_phy,itaufin,calend)
     507c       Copy all threadprivate variables from logic_mod
     508c$OMP1 COPYIN(purmats,forward,leapf,apphys,statcl,conser,apdiss,apdelq)
     509c$OMP1 COPYIN(saison,ecripar,fxyhypb,ysinus,read_start,ok_guide)
     510c$OMP1 COPYIN(ok_strato,ok_gradsfile,ok_limit,ok_etat0)
     511c$OMP1 COPYIN(iflag_phys,iflag_trac)
    507512      CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,time_0)
    508513c$OMP END PARALLEL
  • LMDZ5/trunk/libf/dyn3dpar/gradiv_p.F

    r1907 r2603  
    2121#include "paramet.h"
    2222#include "comdissipn.h"
    23 #include "logic.h"
    2423
    2524      INTEGER klevel
  • LMDZ5/trunk/libf/dyn3dpar/iniacademic.F90

    r2601 r2603  
    1717  use exner_milieu_m, only: exner_milieu
    1818  USE comconst_mod, ONLY: cpp, kappa, g, daysec, dtvr, pi, im, jm
     19  USE logic_mod, ONLY: iflag_phys, read_start
    1920  USE comvert_mod, ONLY: ap, bp, preff, presnivs, pressure_exner
    2021  USE temps_mod, ONLY: annee_ref, day_ini, day_ref
     
    3536  include "ener.h"
    3637  include "iniprint.h"
    37   include "logic.h"
    3838
    3939  !   Arguments:
  • LMDZ5/trunk/libf/dyn3dpar/initdynav_p.F

    r2601 r2603  
    4848#include "comgeom.h"
    4949#include "ener.h"
    50 #include "logic.h"
    5150#include "description.h"
    5251#include "iniprint.h"
  • LMDZ5/trunk/libf/dyn3dpar/initfluxsto_p.F

    r2601 r2603  
    5050#include "comgeom.h"
    5151#include "ener.h"
    52 #include "logic.h"
    5352#include "description.h"
    5453#include "iniprint.h"
  • LMDZ5/trunk/libf/dyn3dpar/inithist_p.F

    r2601 r2603  
    5050#include "comgeom.h"
    5151#include "ener.h"
    52 #include "logic.h"
    5352#include "description.h"
    5453#include "iniprint.h"
  • LMDZ5/trunk/libf/dyn3dpar/integrd_p.F

    r2601 r2603  
    88      USE control_mod, only : planet_type
    99      USE comconst_mod, ONLY: pi
     10      USE logic_mod, ONLY: leapf
    1011      USE comvert_mod, ONLY: ap, bp
    1112      USE temps_mod, ONLY: dt
     
    3233#include "paramet.h"
    3334#include "comgeom.h"
    34 #include "logic.h"
    3535#include "iniprint.h"
    3636
  • LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F

    r2601 r2603  
    3030       USE comvert_mod, ONLY: ap,bp,pressure_exner,presnivs
    3131       USE comconst_mod, ONLY: cpp, dtvr, ihf, dtphys, pi, jmp1
     32       USE logic_mod, ONLY: iflag_phys,ok_guide,forward,leapf,apphys,
     33     &                      statcl,conser,apdiss,purmats,ok_strato
    3234       USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini,
    3335     &                        day_ref,start_time,dt
     
    7072#include "comdissnew.h"
    7173#include "comgeom.h"
    72 #include "logic.h"
    7374#include "ener.h"
    7475#include "description.h"
  • LMDZ5/trunk/libf/dyn3dpar/logic_mod.F90

    r2600 r2603  
    22! $Id$
    33!
    4 !
    5 ! NB: keep items of different kinds in seperate common blocs to avoid
    6 !     "misaligned commons" issues
    7 !-----------------------------------------------------------------------
    8 ! INCLUDE 'logic.h'
     4MODULE logic_mod
    95
    10       COMMON/logicl/ purmats,forward,leapf,apphys,                      &
    11      &  statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus       &
    12      &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    13      &  ,ok_limit,ok_etat0,hybrid
     6IMPLICIT NONE
    147
    15       COMMON/logici/ iflag_phys,iflag_trac
    16      
    17       LOGICAL purmats,forward,leapf,apphys,statcl,conser,               &
    18      & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    19      &  ,read_start,ok_guide,ok_strato,ok_gradsfile                     &
    20      &  ,ok_limit,ok_etat0
     8  LOGICAL purmats ! true if time stepping is purely Matsuno scheme
     9                  ! false implies Matsuno-Leapfrog time stepping scheme
     10  LOGICAL forward ! true if during forward phase of Matsuno step
     11  LOGICAL leapf ! true if during a leapfrog time stepping step
     12  LOGICAL apphys ! true if during a time step when physics will be called
     13  LOGICAL statcl
     14  LOGICAL conser
     15  LOGICAL apdiss ! true if during a time step when dissipation will be called
     16  LOGICAL apdelq
     17  LOGICAL saison
     18  LOGICAL ecripar
     19  LOGICAL fxyhypb ! true if using hyperbolic function discretization
     20                  ! for latitudinal grid
     21  LOGICAL ysinus ! true if using sine function discretiation
     22                 ! for latitudinal grid
     23  LOGICAL read_start ! true if reading a start.nc file to initialize fields
     24  LOGICAL ok_guide ! true if nudging
     25  LOGICAL ok_strato
     26  LOGICAL ok_gradsfile
     27  LOGICAL ok_limit
     28  LOGICAL ok_etat0
     29  LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
     30                 ! (only used if disvert_type==2)
     31  INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package,
     32                     ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets
     33  INTEGER iflag_trac
    2134
    22       logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    23                      ! (only used if disvert_type==2)
     35!$OMP THREADPRIVATE(purmats,forward,leapf,apphys,statcl,conser, &
     36!$OMP     apdiss,apdelq,saison,ecripar,fxyhypb,ysinus, &
     37!$OMP     read_start,ok_guide,ok_strato,ok_gradsfile, &
     38!$OMP     ok_limit,ok_etat0,hybrid)
     39!$OMP THREADPRIVATE(iflag_phys,iflag_trac)
    2440
    25       integer iflag_phys,iflag_trac
    26 !$OMP THREADPRIVATE(/logicl/)
    27 !$OMP THREADPRIVATE(/logici/)
    28 !-----------------------------------------------------------------------
     41!WARNING: when adding a threadprivate variable in this module
     42!        do not forget to add it to the copyin clause when opening an OpenMP
     43!        parallel section. e.g. in gcm before call leapfrog_loc
     44
     45END MODULE logic_mod
  • LMDZ5/trunk/libf/dyn3dpar/nxgrarot_p.F

    r1907 r2603  
    2222#include "paramet.h"
    2323#include "comdissipn.h"
    24 #include "logic.h"
    2524c
    2625      INTEGER klevel
  • LMDZ5/trunk/libf/dyn3dpar/tourpot_p.F

    r1907 r2603  
    2323#include "paramet.h"
    2424#include "comgeom.h"
    25 #include "logic.h"
    2625
    2726      REAL  rot( ip1jm,llm )
  • LMDZ5/trunk/libf/dyn3dpar/vlsplt_p.F

    r2600 r2603  
    2525#include "dimensions.h"
    2626#include "paramet.h"
    27 #include "logic.h"
    2827
    2928c
     
    206205#include "dimensions.h"
    207206#include "paramet.h"
    208 #include "logic.h"
    209207c
    210208c
     
    540538#include "dimensions.h"
    541539#include "paramet.h"
    542 #include "logic.h"
    543540#include "comgeom.h"
    544541c
     
    927924#include "dimensions.h"
    928925#include "paramet.h"
    929 #include "logic.h"
    930926c
    931927c
  • LMDZ5/trunk/libf/dyn3dpar/vlspltgen_p.F

    r2600 r2603  
    3333#include "dimensions.h"
    3434#include "paramet.h"
    35 #include "logic.h"
    3635
    3736c
  • LMDZ5/trunk/libf/dyn3dpar/vlspltqs_p.F

    r2600 r2603  
    3131#include "dimensions.h"
    3232#include "paramet.h"
    33 #include "logic.h"
    3433
    3534c
     
    235234#include "dimensions.h"
    236235#include "paramet.h"
    237 #include "logic.h"
    238236c
    239237c
     
    586584#include "dimensions.h"
    587585#include "paramet.h"
    588 #include "logic.h"
    589586#include "comgeom.h"
    590587c
  • LMDZ5/trunk/libf/dyn3dpar/writedynav_p.F

    r2601 r2603  
    4747#include "comgeom.h"
    4848#include "ener.h"
    49 #include "logic.h"
    5049#include "description.h"
    5150#include "iniprint.h"
  • LMDZ5/trunk/libf/dyn3dpar/writehist_p.F

    r2601 r2603  
    4747#include "comgeom.h"
    4848#include "ener.h"
    49 #include "logic.h"
    5049#include "description.h"
    5150#include "iniprint.h"
Note: See TracChangeset for help on using the changeset viewer.