Ignore:
Timestamp:
Jul 24, 2024, 12:45:32 PM (6 months ago)
Author:
abarral
Message:

Rename modules in phy_common from *_mod > lmdz_*

Location:
LMDZ6/branches/Amaury_dev/libf/phy_common
Files:
4 edited
8 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_abort_physic.F90

    r5111 r5112  
    88    USE IOIPSL
    99    USE lmdz_phys_para
    10     USE print_control_mod, ONLY: lunout
     10    USE lmdz_print_control, ONLY: lunout
    1111    IMPLICIT NONE
    1212
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_geometry.F90

    r5111 r5112  
    1 MODULE geometry_mod
     1MODULE lmdz_geometry
     2  ! Store informations concerning the local (to MPI/OpenMP core) geometry
    23
    3 ! Store informations concerning the local (to MPI/OpenMP core) geometry
     4  REAL, SAVE, ALLOCATABLE :: longitude(:) ! longitude of the cell (rad)
     5  !$OMP THREADPRIVATE(longitude)
    46
    5   REAL,SAVE,ALLOCATABLE :: longitude(:) ! longitude of the cell (rad)
    6 !$OMP THREADPRIVATE(longitude)
     7  REAL, SAVE, ALLOCATABLE :: latitude(:)! latitude of the cell (rad)
     8  !$OMP THREADPRIVATE(latitude)
    79
    8   REAL,SAVE,ALLOCATABLE :: latitude(:)! latitude of the cell (rad)
    9 !$OMP THREADPRIVATE(latitude)
     10  REAL, SAVE, ALLOCATABLE :: longitude_deg(:) ! longitude of the cell (degree)
     11  !$OMP THREADPRIVATE(longitude_deg)
    1012
    11   REAL,SAVE,ALLOCATABLE :: longitude_deg(:) ! longitude of the cell (degree)
    12 !$OMP THREADPRIVATE(longitude_deg)
     13  REAL, SAVE, ALLOCATABLE :: latitude_deg(:)! latitude of the cell (degree)
     14  !$OMP THREADPRIVATE(latitude_deg)
    1315
    14   REAL,SAVE,ALLOCATABLE :: latitude_deg(:)! latitude of the cell (degree)
    15 !$OMP THREADPRIVATE(latitude_deg)
     16  REAL, SAVE, ALLOCATABLE :: boundslon(:, :)  ! boundaries of the cell (rad)
     17  !$OMP THREADPRIVATE(boundslon)
    1618
    17   REAL,SAVE,ALLOCATABLE :: boundslon(:,:) ! boundaries of the cell (rad)
    18 !$OMP THREADPRIVATE(boundslon)
     19  REAL, SAVE, ALLOCATABLE :: boundslat(:, :) ! boundaries of the cell (rad)
     20  !$OMP THREADPRIVATE(boundslat)
    1921
    20   REAL,SAVE,ALLOCATABLE :: boundslat(:,:) ! boundaries of the cell (rad)
    21 !$OMP THREADPRIVATE(boundslat)
     22  REAL, SAVE, ALLOCATABLE :: dx(:)      ! resolution of longitude cell (valid only for 2D grid)
     23  !$OMP THREADPRIVATE(dx)
    2224
    23   REAL,SAVE,ALLOCATABLE :: dx(:)      ! resolution of longitude cell (valid only for 2D grid)
    24 !$OMP THREADPRIVATE(dx)
    25  
    26   REAL,SAVE,ALLOCATABLE :: dy(:)      ! resolution of latitude cell (valid only for 2D grid)
    27 !$OMP THREADPRIVATE(dy)
     25  REAL, SAVE, ALLOCATABLE :: dy(:)      ! resolution of latitude cell (valid only for 2D grid)
     26  !$OMP THREADPRIVATE(dy)
    2827
    29   REAL,SAVE,ALLOCATABLE :: cell_area(:)      ! area of the cell
    30 !$OMP THREADPRIVATE(cell_area)
     28  REAL, SAVE, ALLOCATABLE :: cell_area(:)      ! area of the cell
     29  !$OMP THREADPRIVATE(cell_area)
    3130
    32   INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:)      ! global indice of a local cell
    33 !$OMP THREADPRIVATE(ind_cell_glo)
     31  INTEGER, SAVE, ALLOCATABLE :: ind_cell_glo(:)      ! global indice of a local cell
     32  !$OMP THREADPRIVATE(ind_cell_glo)
    3433
    3534CONTAINS
    3635
    37   SUBROUTINE init_geometry(klon,longitude_,latitude_, &
    38                            boundslon_,boundslat_, &
    39                            cell_area_,ind_cell_glo_,dx_,dy_)
    40   USE lmdz_grid_phy, ONLY: nvertex
    41   USE nrtype, ONLY: PI
    42   IMPLICIT NONE
    43     INTEGER,INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
    44     REAL,INTENT(IN) :: longitude_(klon)
    45     REAL,INTENT(IN) :: latitude_(klon)
    46     REAL,INTENT(IN) :: boundslon_(klon,nvertex)
    47     REAL,INTENT(IN) :: boundslat_(klon,nvertex)
    48     REAL,INTENT(IN) :: cell_area_(klon)
    49     INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon)
    50     REAL,OPTIONAL,INTENT(IN) :: dx_(klon)
    51     REAL,OPTIONAL,INTENT(IN) :: dy_(klon)
    52    
     36  SUBROUTINE init_geometry(klon, longitude_, latitude_, &
     37          boundslon_, boundslat_, &
     38          cell_area_, ind_cell_glo_, dx_, dy_)
     39    USE lmdz_grid_phy, ONLY: nvertex
     40    USE nrtype, ONLY: PI
     41    IMPLICIT NONE
     42    INTEGER, INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
     43    REAL, INTENT(IN) :: longitude_(klon)
     44    REAL, INTENT(IN) :: latitude_(klon)
     45    REAL, INTENT(IN) :: boundslon_(klon, nvertex)
     46    REAL, INTENT(IN) :: boundslat_(klon, nvertex)
     47    REAL, INTENT(IN) :: cell_area_(klon)
     48    INTEGER, OPTIONAL, INTENT(IN) :: ind_cell_glo_(klon)
     49    REAL, OPTIONAL, INTENT(IN) :: dx_(klon)
     50    REAL, OPTIONAL, INTENT(IN) :: dy_(klon)
     51
    5352    ALLOCATE(longitude(klon))
    5453    ALLOCATE(latitude(klon))
    5554    ALLOCATE(longitude_deg(klon))
    5655    ALLOCATE(latitude_deg(klon))
    57     ALLOCATE(boundslon(klon,nvertex))
    58     ALLOCATE(boundslat(klon,nvertex))
     56    ALLOCATE(boundslon(klon, nvertex))
     57    ALLOCATE(boundslat(klon, nvertex))
    5958    ALLOCATE(cell_area(klon))
    6059    IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon))
    6160    IF (PRESENT(dx_)) ALLOCATE(dx(klon))
    6261    IF (PRESENT(dy_))ALLOCATE(dy(klon))
    63    
     62
    6463    longitude(:) = longitude_(:)
    6564    latitude(:) = latitude_(:)
    66     longitude_deg(:) = longitude(:)*180./PI
    67     latitude_deg(:) = latitude(:)*180./PI
    68     boundslon(:,:) = boundslon_(:,:)
    69     boundslat(:,:) = boundslat_(:,:)
     65    longitude_deg(:) = longitude(:) * 180. / PI
     66    latitude_deg(:) = latitude(:) * 180. / PI
     67    boundslon(:, :) = boundslon_(:, :)
     68    boundslat(:, :) = boundslat_(:, :)
    7069    cell_area(:) = cell_area_(:)
    7170    IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:)
    7271    IF (PRESENT(dx_)) dx(:) = dx_(:)
    7372    IF (PRESENT(dy_)) dy(:) = dy_(:)
    74    
     73
    7574  END SUBROUTINE init_geometry
    7675
    7776
    78 END MODULE geometry_mod
    79 
     77END MODULE lmdz_geometry
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_init_print_control.F90

    r5111 r5112  
    1 MODULE init_print_control_mod
     1MODULE lmdz_init_print_control
    22
    3 ! init_print_control to initialize print_control_mod variables
    4 ! not included there because of circular dependecy issues
     3  ! init_print_control to initialize lmdz_print_control variables
     4  ! not included there because of circular dependecy issues
    55
    66CONTAINS
    77
    88  SUBROUTINE init_print_control
    9   USE print_control_mod, ONLY: set_print_control
    10   USE ioipsl_getin_p_mod, ONLY: getin_p
    11   USE lmdz_phys_para, ONLY: is_omp_root, is_master
    12   IMPLICIT NONE
     9    USE lmdz_print_control, ONLY: set_print_control
     10    USE lmdz_ioipsl_getin_p, ONLY: getin_p
     11    USE lmdz_phys_para, ONLY: is_omp_root, is_master
     12    IMPLICIT NONE
    1313
    1414    INTEGER :: lunout ! default output file identifier (6==screen)
     
    1717    LOGICAL :: opened
    1818    INTEGER :: number
    19    
     19
    2020    !Config  Key  = prt_level
    2121    !Config  Desc = niveau d'impressions de débogage
     
    2424    !Config         (0 = minimum d'impression)
    2525    prt_level = 0
    26     CALL getin_p('prt_level',prt_level)
     26    CALL getin_p('prt_level', prt_level)
    2727
    2828    !Config  Key  = lunout
     
    3131    !Config  Help = unite de fichier pour les impressions
    3232    !Config         (defaut sortie standard = 6)
    33     lunout=6
     33    lunout = 6
    3434    CALL getin_p('lunout', lunout)
    3535
    3636    IF (is_omp_root) THEN
    3737      IF (lunout /= 5 .and. lunout /= 6) THEN
    38          INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)
    39          IF (opened) THEN
    40            lunout=number
    41          ELSE
    42            OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', &
    43                 STATUS='unknown',FORM='formatted')
    44          ENDIF
     38        INQUIRE(FILE = 'lmdz.out_0000', OPENED = opened, NUMBER = number)
     39        IF (opened) THEN
     40          lunout = number
     41        ELSE
     42          OPEN(UNIT = lunout, FILE = 'lmdz.out_0000', ACTION = 'write', &
     43                  STATUS = 'unknown', FORM = 'formatted')
     44        ENDIF
    4545      ENDIF
    4646    ENDIF
     
    5252
    5353    debug = .FALSE.
    54     CALL getin_p('debug',debug)
    55    
     54    CALL getin_p('debug', debug)
     55
    5656    IF (is_master) THEN
    57       WRITE(lunout,*)"init_print_control: prt_level=",prt_level
    58       WRITE(lunout,*)"init_print_control: lunout=",lunout
    59       WRITE(lunout,*)"init_print_control: debug=",debug     
     57      WRITE(lunout, *)"init_print_control: prt_level=", prt_level
     58      WRITE(lunout, *)"init_print_control: lunout=", lunout
     59      WRITE(lunout, *)"init_print_control: debug=", debug
    6060    ENDIF
    61    
    62     CALL set_print_control(lunout,prt_level,debug)
    6361
    64   END SUBROUTINE init_print_control 
     62    CALL set_print_control(lunout, prt_level, debug)
    6563
    66 END MODULE init_print_control_mod
     64  END SUBROUTINE init_print_control
    6765
     66END MODULE lmdz_init_print_control
     67
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_ioipsl_getin_p.F90

    r5111 r5112  
    1 
    21! $Id$
    32
    4 MODULE ioipsl_getin_p_mod
    5 ! To use getin in a parallel context
    6 !---------------------------------------------------------------------
    7 USE ioipsl, ONLY: getin
    8 USE lmdz_phys_mpi_data, ONLY: is_mpi_root
    9 USE lmdz_phys_omp_data, ONLY: is_omp_root
    10 USE lmdz_phys_transfert_para, ONLY: bcast
    11 !-
    12 IMPLICIT NONE
    13 !-
    14 PRIVATE
    15 PUBLIC :: getin_p
    16 !-
    17 INTERFACE getin_p
     3MODULE lmdz_ioipsl_getin_p
     4  ! To use getin in a parallel context
     5  !---------------------------------------------------------------------
     6  USE ioipsl, ONLY: getin
     7  USE lmdz_phys_mpi_data, ONLY: is_mpi_root
     8  USE lmdz_phys_omp_data, ONLY: is_omp_root
     9  USE lmdz_phys_transfert_para, ONLY: bcast
     10  !-
     11  IMPLICIT NONE
     12  !-
     13  PRIVATE
     14  PUBLIC :: getin_p
     15  !-
     16  INTERFACE getin_p
    1817
    19   MODULE PROCEDURE getinrs_p, getinr1d_p, getinr2d_p, &
    20                    getinis_p, getini1d_p, getini2d_p, &
    21                    getincs_p,                        &
    22                    getinls_p, getinl1d_p, getinl2d_p
    23 END INTERFACE
    24 !-
     18    MODULE PROCEDURE getinrs_p, getinr1d_p, getinr2d_p, &
     19            getinis_p, getini1d_p, getini2d_p, &
     20            getincs_p, &
     21            getinls_p, getinl1d_p, getinl2d_p
     22  END INTERFACE
     23  !-
    2524CONTAINS
    2625
    2726
    28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    29 !!   Definition des getin -> bcast      !!
    30 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     27  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     28  !!   Definition des getin -> bcast      !!
     29  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    3130
    32 !! -- Les chaines de caracteres -- !!
    33  
    34   SUBROUTINE getincs_p(VarIn,VarOut)
    35     IMPLICIT NONE   
    36     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    37     CHARACTER(LEN=*),INTENT(INOUT) :: VarOut   
     31  !! -- Les chaines de caracteres -- !!
    3832
    39 !$OMP BARRIER
     33  SUBROUTINE getincs_p(VarIn, VarOut)
     34    IMPLICIT NONE
     35    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     36    CHARACTER(LEN = *), INTENT(INOUT) :: VarOut
     37
     38    !$OMP BARRIER
    4039    IF (is_mpi_root .AND. is_omp_root) THEN
    41         CALL getin(VarIn,VarOut)
     40      CALL getin(VarIn, VarOut)
    4241    ENDIF
    4342    CALL bcast(VarOut)
    4443  END SUBROUTINE getincs_p
    4544
    46 !! -- Les entiers -- !!
    47  
    48   SUBROUTINE getinis_p(VarIn,VarOut)
    49     IMPLICIT NONE   
    50     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    51     INTEGER,INTENT(INOUT) :: VarOut   
     45  !! -- Les entiers -- !!
    5246
    53 !$OMP BARRIER
     47  SUBROUTINE getinis_p(VarIn, VarOut)
     48    IMPLICIT NONE
     49    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     50    INTEGER, INTENT(INOUT) :: VarOut
     51
     52    !$OMP BARRIER
    5453    IF (is_mpi_root .AND. is_omp_root) THEN
    55         CALL getin(VarIn,VarOut)
     54      CALL getin(VarIn, VarOut)
    5655    ENDIF
    5756    CALL bcast(VarOut)
    5857  END SUBROUTINE getinis_p
    5958
    60   SUBROUTINE getini1d_p(VarIn,VarOut)
    61     IMPLICIT NONE   
    62     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    63     INTEGER,INTENT(INOUT) :: VarOut(:)
     59  SUBROUTINE getini1d_p(VarIn, VarOut)
     60    IMPLICIT NONE
     61    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     62    INTEGER, INTENT(INOUT) :: VarOut(:)
    6463
    65 !$OMP BARRIER
     64    !$OMP BARRIER
    6665    IF (is_mpi_root .AND. is_omp_root) THEN
    67         CALL getin(VarIn,VarOut)
     66      CALL getin(VarIn, VarOut)
    6867    ENDIF
    6968    CALL bcast(VarOut)
    7069  END SUBROUTINE getini1d_p
    7170
    72   SUBROUTINE getini2d_p(VarIn,VarOut)
    73     IMPLICIT NONE   
    74     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    75     INTEGER,INTENT(INOUT) :: VarOut(:,:)
     71  SUBROUTINE getini2d_p(VarIn, VarOut)
     72    IMPLICIT NONE
     73    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     74    INTEGER, INTENT(INOUT) :: VarOut(:, :)
    7675
    77 !$OMP BARRIER
     76    !$OMP BARRIER
    7877    IF (is_mpi_root .AND. is_omp_root) THEN
    79         CALL getin(VarIn,VarOut)
     78      CALL getin(VarIn, VarOut)
    8079    ENDIF
    8180    CALL bcast(VarOut)
    8281  END SUBROUTINE getini2d_p
    8382
    84 !! -- Les flottants -- !!
    85  
    86   SUBROUTINE getinrs_p(VarIn,VarOut)
    87     IMPLICIT NONE   
    88     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    89     REAL,INTENT(INOUT) :: VarOut
     83  !! -- Les flottants -- !!
    9084
    91 !$OMP BARRIER
     85  SUBROUTINE getinrs_p(VarIn, VarOut)
     86    IMPLICIT NONE
     87    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     88    REAL, INTENT(INOUT) :: VarOut
     89
     90    !$OMP BARRIER
    9291    IF (is_mpi_root .AND. is_omp_root) THEN
    93         CALL getin(VarIn,VarOut)
     92      CALL getin(VarIn, VarOut)
    9493    ENDIF
    9594    CALL bcast(VarOut)
    9695  END SUBROUTINE getinrs_p
    9796
    98   SUBROUTINE getinr1d_p(VarIn,VarOut)
    99     IMPLICIT NONE   
    100     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    101     REAL,INTENT(INOUT) :: VarOut(:)
     97  SUBROUTINE getinr1d_p(VarIn, VarOut)
     98    IMPLICIT NONE
     99    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     100    REAL, INTENT(INOUT) :: VarOut(:)
    102101
    103 !$OMP BARRIER
     102    !$OMP BARRIER
    104103    IF (is_mpi_root .AND. is_omp_root) THEN
    105         CALL getin(VarIn,VarOut)
     104      CALL getin(VarIn, VarOut)
    106105    ENDIF
    107106    CALL bcast(VarOut)
    108107  END SUBROUTINE getinr1d_p
    109108
    110   SUBROUTINE getinr2d_p(VarIn,VarOut)
    111     IMPLICIT NONE   
    112     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    113     REAL,INTENT(INOUT) :: VarOut(:,:)
     109  SUBROUTINE getinr2d_p(VarIn, VarOut)
     110    IMPLICIT NONE
     111    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     112    REAL, INTENT(INOUT) :: VarOut(:, :)
    114113
    115 !$OMP BARRIER
     114    !$OMP BARRIER
    116115    IF (is_mpi_root .AND. is_omp_root) THEN
    117         CALL getin(VarIn,VarOut)
     116      CALL getin(VarIn, VarOut)
    118117    ENDIF
    119118    CALL bcast(VarOut)
    120119  END SUBROUTINE getinr2d_p
    121120
    122 !! -- Les Booleens -- !!
    123  
    124   SUBROUTINE getinls_p(VarIn,VarOut)
    125     IMPLICIT NONE   
    126     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    127     LOGICAL,INTENT(INOUT) :: VarOut
     121  !! -- Les Booleens -- !!
    128122
    129 !$OMP BARRIER
     123  SUBROUTINE getinls_p(VarIn, VarOut)
     124    IMPLICIT NONE
     125    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     126    LOGICAL, INTENT(INOUT) :: VarOut
     127
     128    !$OMP BARRIER
    130129    IF (is_mpi_root .AND. is_omp_root) THEN
    131         CALL getin(VarIn,VarOut)
     130      CALL getin(VarIn, VarOut)
    132131    ENDIF
    133132    CALL bcast(VarOut)
    134133  END SUBROUTINE getinls_p
    135134
    136   SUBROUTINE getinl1d_p(VarIn,VarOut)
    137     IMPLICIT NONE   
    138     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    139     LOGICAL,INTENT(INOUT) :: VarOut(:)
     135  SUBROUTINE getinl1d_p(VarIn, VarOut)
     136    IMPLICIT NONE
     137    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     138    LOGICAL, INTENT(INOUT) :: VarOut(:)
    140139
    141 !$OMP BARRIER
     140    !$OMP BARRIER
    142141    IF (is_mpi_root .AND. is_omp_root) THEN
    143         CALL getin(VarIn,VarOut)
     142      CALL getin(VarIn, VarOut)
    144143    ENDIF
    145144    CALL bcast(VarOut)
    146145  END SUBROUTINE getinl1d_p
    147146
    148   SUBROUTINE getinl2d_p(VarIn,VarOut)
    149     IMPLICIT NONE   
    150     CHARACTER(LEN=*),INTENT(IN) :: VarIn
    151     LOGICAL,INTENT(INOUT) :: VarOut(:,:)
     147  SUBROUTINE getinl2d_p(VarIn, VarOut)
     148    IMPLICIT NONE
     149    CHARACTER(LEN = *), INTENT(IN) :: VarIn
     150    LOGICAL, INTENT(INOUT) :: VarOut(:, :)
    152151
    153 !$OMP BARRIER
     152    !$OMP BARRIER
    154153    IF (is_mpi_root .AND. is_omp_root) THEN
    155         CALL getin(VarIn,VarOut)
     154      CALL getin(VarIn, VarOut)
    156155    ENDIF
    157156    CALL bcast(VarOut)
    158157  END SUBROUTINE getinl2d_p
    159 !-
    160 !-----------------------------
    161 !-----------------------------
    162 !-----------------------------
     158  !-
     159  !-----------------------------
     160  !-----------------------------
     161  !-----------------------------
    163162
    164 END MODULE ioipsl_getin_p_mod
     163END MODULE lmdz_ioipsl_getin_p
    165164
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_mpi_data.F90

    r5110 r5112  
    184184
    185185  SUBROUTINE print_module_data
    186   USE print_control_mod, ONLY: lunout
     186  USE lmdz_print_control, ONLY: lunout
    187187  IMPLICIT NONE
    188188!  INCLUDE "iniprint.h"
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_data.F90

    r5111 r5112  
    108108
    109109  SUBROUTINE Print_module_data
    110   USE print_control_mod, ONLY: lunout
     110  USE lmdz_print_control, ONLY: lunout
    111111  IMPLICIT NONE
    112112!  INCLUDE "iniprint.h"
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_para.f90

    r5110 r5112  
    5252  SUBROUTINE Test_transfert
    5353  USE lmdz_grid_phy
    54   USE print_control_mod, ONLY: lunout
     54  USE lmdz_print_control, ONLY: lunout
    5555  IMPLICIT NONE
    5656!    INCLUDE "iniprint.h"
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_physics_distribution.F90

    r5111 r5112  
    1 
    21!$Id$
    32
    4 MODULE physics_distribution_mod
     3MODULE lmdz_physics_distribution
    54
    65
     
    87
    98  SUBROUTINE init_physics_distribution(grid_type, nvertex, &
    10                                        nbp, nbp_lon, nbp_lat, nbp_lev, &
    11                                        communicator)
    12   USE lmdz_phys_para, ONLY: init_phys_lmdz_para, klon_omp
    13   USE lmdz_grid_phy, ONLY: init_grid_phy_lmdz
    14   USE dimphy, ONLY: Init_dimphy
    15   USE infotrac_phy, ONLY: type_trac
     9          nbp, nbp_lon, nbp_lat, nbp_lev, &
     10          communicator)
     11    USE lmdz_phys_para, ONLY: init_phys_lmdz_para, klon_omp
     12    USE lmdz_grid_phy, ONLY: init_grid_phy_lmdz
     13    USE dimphy, ONLY: Init_dimphy
     14    USE infotrac_phy, ONLY: type_trac
    1615#ifdef REPROBUS
    1716  USE CHEM_REP, ONLY: Init_chem_rep_phys
    1817#endif
    19   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
    20   IMPLICIT NONE
    21     INTEGER,INTENT(IN) :: grid_type
    22     INTEGER,INTENT(IN) :: nvertex
    23     INTEGER,INTENT(IN) :: nbp           
    24     INTEGER,INTENT(IN) :: nbp_lon
    25     INTEGER,INTENT(IN) :: nbp_lat
    26     INTEGER,INTENT(IN) :: nbp_lev
    27     INTEGER,INTENT(IN) :: communicator
     18    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     19    IMPLICIT NONE
     20    INTEGER, INTENT(IN) :: grid_type
     21    INTEGER, INTENT(IN) :: nvertex
     22    INTEGER, INTENT(IN) :: nbp
     23    INTEGER, INTENT(IN) :: nbp_lon
     24    INTEGER, INTENT(IN) :: nbp_lat
     25    INTEGER, INTENT(IN) :: nbp_lev
     26    INTEGER, INTENT(IN) :: communicator
    2827
     28    CALL init_grid_phy_lmdz(grid_type, nvertex, nbp_lon, nbp_lat, nbp_lev)
     29    CALL init_phys_lmdz_para(nbp, nbp_lon, nbp_lat, nbp_lev, grid_type, nvertex, communicator)
     30    !$OMP PARALLEL
     31    CALL init_dimphy(klon_omp, nbp_lev)
    2932
    30     CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev)
    31     CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat,nbp_lev, grid_type,nvertex, communicator)
    32 !$OMP PARALLEL
    33     CALL init_dimphy(klon_omp,nbp_lev)
    34 
    35   IF (CPPKEY_INCA) THEN
    36        CALL Init_inca_dim(klon_omp,nbp_lev)
    37   END IF
     33    IF (CPPKEY_INCA) THEN
     34      CALL Init_inca_dim(klon_omp, nbp_lev)
     35    END IF
    3836
    3937#ifdef REPROBUS
     
    4240#endif
    4341
    44 !$OMP END PARALLEL
     42    !$OMP END PARALLEL
    4543
    46   END SUBROUTINE init_physics_distribution 
     44  END SUBROUTINE init_physics_distribution
    4745
    48 !SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)
    49 !  USE lmdz_phys_para, ONLY: Init_phys_lmdz_para!, klon_omp
    50 !  USE lmdz_grid_phy, ONLY: Init_grid_phy_lmdz!, nbp_lev
    51 !  USE dimphy, ONLY: Init_dimphy
    52 !  USE infotrac_phy, ONLY: type_trac
    53 !#ifdef REPROBUS
    54 !  USE CHEM_REP, ONLY: Init_chem_rep_phys
    55 !#endif
     46  !SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)
     47  !  USE lmdz_phys_para, ONLY: Init_phys_lmdz_para!, klon_omp
     48  !  USE lmdz_grid_phy, ONLY: Init_grid_phy_lmdz!, nbp_lev
     49  !  USE dimphy, ONLY: Init_dimphy
     50  !  USE infotrac_phy, ONLY: type_trac
     51  !#ifdef REPROBUS
     52  !  USE CHEM_REP, ONLY: Init_chem_rep_phys
     53  !#endif
    5654
    57 !  IMPLICIT NONE
    58  
    59 !    INTEGER,INTENT(in) :: iim
    60 !    INTEGER,INTENT(in) :: jjp1
    61 !    INTEGER,INTENT(in) :: llm
    62 !    INTEGER,INTENT(in) :: nb_proc
    63 !    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
     55  !  IMPLICIT NONE
     56
     57  !    INTEGER,INTENT(in) :: iim
     58  !    INTEGER,INTENT(in) :: jjp1
     59  !    INTEGER,INTENT(in) :: llm
     60  !    INTEGER,INTENT(in) :: nb_proc
     61  !    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
    6462
    6563
    66 !    CALL Init_grid_phy_lmdz(iim,jjp1,llm)
    67 !    CALL Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
    68 !!$OMP PARALLEL
    69 !    CALL Init_dimphy(klon_omp,nbp_lev)
     64  !    CALL Init_grid_phy_lmdz(iim,jjp1,llm)
     65  !    CALL Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
     66  !!$OMP PARALLEL
     67  !    CALL Init_dimphy(klon_omp,nbp_lev)
    7068
    71 !#ifdef REPROBUS
    72 !! Initialization of Reprobus
    73 !    IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev)
    74 !    END IF
    75 !#endif
     69  !#ifdef REPROBUS
     70  !! Initialization of Reprobus
     71  !    IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev)
     72  !    END IF
     73  !#endif
    7674
    77 !!$OMP END PARALLEL
    78  
    79 !END SUBROUTINE Init_Phys_lmdz 
     75  !!$OMP END PARALLEL
     76
     77  !END SUBROUTINE Init_Phys_lmdz
    8078
    8179
     80END MODULE lmdz_physics_distribution
    8281
    83 
    84 
    85 
    86 
    87 
    88 END MODULE physics_distribution_mod
    89 
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_print_control.f90

    r5111 r5112  
    11! $Id: $
    2 MODULE print_control_mod
     2MODULE lmdz_print_control
    33
    4   INTEGER,SAVE :: lunout ! default output file identifier (6==screen)
    5   INTEGER,SAVE :: prt_level ! debug output level
    6   LOGICAL,SAVE :: debug ! flag to specify if in "debug mode"
    7   LOGICAL,SAVE :: alert_first_CALL = .TRUE. ! for printing alerts on first CALL to routine only
    8   LOGICAL,SAVE :: call_alert ! (combination of is_master and alert_first_CALL for easier use
    9 !$OMP THREADPRIVATE(lunout,prt_level,debug, alert_first_call, call_alert)
     4  INTEGER, SAVE :: lunout ! default output file identifier (6==screen)
     5  INTEGER, SAVE :: prt_level ! debug output level
     6  LOGICAL, SAVE :: debug ! flag to specify if in "debug mode"
     7  LOGICAL, SAVE :: alert_first_CALL = .TRUE. ! for printing alerts on first CALL to routine only
     8  LOGICAL, SAVE :: call_alert ! (combination of is_master and alert_first_CALL for easier use
     9  !$OMP THREADPRIVATE(lunout,prt_level,debug, alert_first_call, call_alert)
    1010
    1111  ! NB: Module variable Initializations done by set_print_control
    12   !     routine from init_print_control_mod to avoid circular
     12  !     routine from lmdz_init_print_control to avoid circular
    1313  !     module dependencies
    1414
    1515CONTAINS
    1616
    17   SUBROUTINE set_print_control(lunout_,prt_level_,debug_)
    18   IMPLICIT NONE
     17  SUBROUTINE set_print_control(lunout_, prt_level_, debug_)
     18    IMPLICIT NONE
    1919    INTEGER, INTENT(IN) :: lunout_
    2020    INTEGER, INTENT(IN) :: prt_level_
    2121    LOGICAL, INTENT(IN) :: debug_
    22      
     22
    2323    lunout = lunout_
    2424    prt_level = prt_level_
    2525    debug = debug_
    26    
     26
    2727  END SUBROUTINE set_print_control
    2828
     
    3535    ! modname: module/routine name
    3636    ! niv_alerte: alert level (0/1/2)
    37     CHARACTER(LEN=*), INTENT(IN) :: modname
    38     CHARACTER(LEN=*) :: message
     37    CHARACTER(LEN = *), INTENT(IN) :: modname
     38    CHARACTER(LEN = *) :: message
    3939    INTEGER :: niv_alerte
    4040    ! local variables
    41     CHARACTER(LEN=7), DIMENSION(0:2) :: alarm_color = (/ 'VERTE  ','ORANGE ','ROUGE  ' /)
    42     CHARACTER(LEN=7) :: alarm_couleur
    43     INTEGER :: alarm_file=15 ! in case we want/need to print out the special alarms in a separate file     
     41    CHARACTER(LEN = 7), DIMENSION(0:2) :: alarm_color = (/ 'VERTE  ', 'ORANGE ', 'ROUGE  ' /)
     42    CHARACTER(LEN = 7) :: alarm_couleur
     43    INTEGER :: alarm_file = 15 ! in case we want/need to print out the special alarms in a separate file
    4444
    45     IF ( alert_first_call) then
    46        IF ( alarm_file /= lunout ) THEN
    47           OPEN(unit = alarm_file, file = "ALERTES.txt")
    48        ENDIF
     45    IF (alert_first_call) then
     46      IF (alarm_file /= lunout) THEN
     47        OPEN(unit = alarm_file, file = "ALERTES.txt")
     48      ENDIF
    4949    ENDIF
    5050
    5151    alarm_couleur = alarm_color(niv_alerte)
    5252    IF (niv_alerte < 0 .OR. niv_alerte > 3) then
    53        message = 'NIVEAU ALERTE INVALIDE  '//message
    54        alarm_couleur='NOIRE  '
     53      message = 'NIVEAU ALERTE INVALIDE  ' // message
     54      alarm_couleur = 'NOIRE  '
    5555    ENDIF
    5656
    57     WRITE(alarm_file, *)' ALERTE ',alarm_couleur, trim(modname), trim(message)
    58    
     57    WRITE(alarm_file, *)' ALERTE ', alarm_couleur, trim(modname), trim(message)
     58
    5959  END SUBROUTINE prt_alerte
    6060
    61  
    62 END MODULE print_control_mod
     61
     62END MODULE lmdz_print_control
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_regular_lonlat.f90

    r5111 r5112  
    1 MODULE regular_lonlat_mod
     1MODULE lmdz_regular_lonlat
    22
    33  ! Store information on the global physics grid
     
    5252  END SUBROUTINE init_regular_lonlat   
    5353
    54 END MODULE regular_lonlat_mod
     54END MODULE lmdz_regular_lonlat
    5555
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_vertical_layers.f90

    r5111 r5112  
    1 ! $Id: $
    2 
    3 MODULE vertical_layers_mod
     1MODULE lmdz_vertical_layers
    42
    53   REAL,SAVE             :: preff  ! reference surface pressure (Pa)
    64   REAL,SAVE             :: scaleheight ! atmospheric reference scale height (km)
    7    REAL,SAVE,ALLOCATABLE :: ap(:) ! hybrid (pressure contribution) coordinate 
     5   REAL,SAVE,ALLOCATABLE :: ap(:) ! hybrid (pressure contribution) coordinate
    86                                  ! at layer interfaces (Pa)
    9    REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid (sigma contribution) coordinate 
     7   REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid (sigma contribution) coordinate
    108                                  ! at layer interfaces (Pa)
    11    REAL,SAVE,ALLOCATABLE :: aps(:) ! hybrid (pressure contribution) coordinate 
     9   REAL,SAVE,ALLOCATABLE :: aps(:) ! hybrid (pressure contribution) coordinate
    1210                                   ! at mid-layer (Pa)
    13    REAL,SAVE,ALLOCATABLE :: bps(:) ! hybrid (sigma contribution) coordinate 
     11   REAL,SAVE,ALLOCATABLE :: bps(:) ! hybrid (sigma contribution) coordinate
    1412                                   ! at mid-layer
    1513   REAL,SAVE,ALLOCATABLE :: presnivs(:) ! reference pressure at mid-layer (Pa),
     
    1917   REAL,SAVE,ALLOCATABLE :: pseudoalt(:) ! pseudo-altitude of model layers (km),
    2018                                         ! based on preff and scaleheight
    21    
     19
    2220!$OMP THREADPRIVATE(preff,scaleheight,ap,bp,aps,bps,presnivs,presinter,pseudoalt)
    2321
     
    3836    REAL,INTENT(IN)    :: presinter_(nlayer+1) ! Appproximative pressure of atm. layers (Pa)
    3937    REAL,INTENT(IN)    :: pseudoalt_(nlayer) ! pseudo-altitude of atm. layers (km)
    40  
     38
    4139    ALLOCATE(ap(nlayer+1))
    4240    ALLOCATE(bp(nlayer+1))
     
    4644    ALLOCATE(presinter(nlayer+1))
    4745    ALLOCATE(pseudoalt(nlayer))
    48  
     46
    4947    preff = preff_
    5048    scaleheight=scaleheight_
     
    5957  END SUBROUTINE init_vertical_layers
    6058
    61 END MODULE vertical_layers_mod
     59END MODULE lmdz_vertical_layers
  • LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_write_field_phy.f90

    r5111 r5112  
    1 
    21! $Id$
    32
    4 MODULE write_field_phy
     3MODULE lmdz_write_field_phy
    54
    65  ! Dump a field on the global (nbp_lon by nbp_lat) physics grid
    7  
    8   CONTAINS
    9  
    10     SUBROUTINE WriteField_phy(name,Field,ll)
     6
     7CONTAINS
     8
     9  SUBROUTINE WriteField_phy(name, Field, ll)
    1110    USE lmdz_phys_para, ONLY: klon_omp, is_mpi_root, &
    12                                   Gather
     11            Gather
    1312    USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat, klon_glo, &
    14                                  Grid1Dto2D_glo
     13            Grid1Dto2D_glo
    1514    USE Write_Field, ONLY: WriteField
    16    
     15
    1716    IMPLICIT NONE
    1817
    19     CHARACTER(len=*),INTENT(IN) :: name
    20     INTEGER,INTENT(IN) :: ll
    21     REAL,INTENT(IN) :: Field(klon_omp,ll)
     18    CHARACTER(len = *), INTENT(IN) :: name
     19    INTEGER, INTENT(IN) :: ll
     20    REAL, INTENT(IN) :: Field(klon_omp, ll)
    2221
    23     real, dimension(klon_glo,ll):: New_Field
    24     real, dimension(nbp_lon,nbp_lat,ll):: Field_2d
     22    real, dimension(klon_glo, ll) :: New_Field
     23    real, dimension(nbp_lon, nbp_lat, ll) :: Field_2d
    2524
    26     CALL Gather(Field,New_Field)
    27 !$OMP MASTER
    28     IF (is_mpi_root) THEN       
    29       CALL Grid1Dto2D_glo(New_Field,Field_2D)
    30       CALL WriteField(name,Field_2d)
     25    CALL Gather(Field, New_Field)
     26    !$OMP MASTER
     27    IF (is_mpi_root) THEN
     28      CALL Grid1Dto2D_glo(New_Field, Field_2D)
     29      CALL WriteField(name, Field_2d)
    3130    ENDIF
    32 !$OMP END MASTER
     31    !$OMP END MASTER
    3332
    34  
    35    END SUBROUTINE WriteField_phy
    36  
    37  END MODULE write_field_phy
     33  END SUBROUTINE WriteField_phy
     34
     35END MODULE lmdz_write_field_phy
Note: See TracChangeset for help on using the changeset viewer.