Changeset 5112 for LMDZ6/branches/Amaury_dev/libf/phy_common
- Timestamp:
- Jul 24, 2024, 12:45:32 PM (6 months ago)
- 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 8 8 USE IOIPSL 9 9 USE lmdz_phys_para 10 USE print_control_mod, ONLY: lunout10 USE lmdz_print_control, ONLY: lunout 11 11 IMPLICIT NONE 12 12 -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_geometry.F90
r5111 r5112 1 MODULE geometry_mod 1 MODULE lmdz_geometry 2 ! Store informations concerning the local (to MPI/OpenMP core) geometry 2 3 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) 4 6 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) 7 9 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) 10 12 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) 13 15 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) 16 18 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) 19 21 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) 22 24 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) 28 27 29 REAL, SAVE,ALLOCATABLE :: cell_area(:) ! area of the cell30 !$OMP THREADPRIVATE(cell_area)28 REAL, SAVE, ALLOCATABLE :: cell_area(:) ! area of the cell 29 !$OMP THREADPRIVATE(cell_area) 31 30 32 INTEGER, SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global indice of a local cell33 !$OMP THREADPRIVATE(ind_cell_glo)31 INTEGER, SAVE, ALLOCATABLE :: ind_cell_glo(:) ! global indice of a local cell 32 !$OMP THREADPRIVATE(ind_cell_glo) 34 33 35 34 CONTAINS 36 35 37 SUBROUTINE init_geometry(klon, longitude_,latitude_, &38 boundslon_,boundslat_, &39 cell_area_,ind_cell_glo_,dx_,dy_)40 USE lmdz_grid_phy, ONLY: nvertex41 USE nrtype, ONLY: PI42 IMPLICIT NONE43 INTEGER, INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain44 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 53 52 ALLOCATE(longitude(klon)) 54 53 ALLOCATE(latitude(klon)) 55 54 ALLOCATE(longitude_deg(klon)) 56 55 ALLOCATE(latitude_deg(klon)) 57 ALLOCATE(boundslon(klon, nvertex))58 ALLOCATE(boundslat(klon, nvertex))56 ALLOCATE(boundslon(klon, nvertex)) 57 ALLOCATE(boundslat(klon, nvertex)) 59 58 ALLOCATE(cell_area(klon)) 60 59 IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) 61 60 IF (PRESENT(dx_)) ALLOCATE(dx(klon)) 62 61 IF (PRESENT(dy_))ALLOCATE(dy(klon)) 63 62 64 63 longitude(:) = longitude_(:) 65 64 latitude(:) = latitude_(:) 66 longitude_deg(:) = longitude(:) *180./PI67 latitude_deg(:) = latitude(:) *180./PI68 boundslon(:, :) = boundslon_(:,:)69 boundslat(:, :) = boundslat_(:,:)65 longitude_deg(:) = longitude(:) * 180. / PI 66 latitude_deg(:) = latitude(:) * 180. / PI 67 boundslon(:, :) = boundslon_(:, :) 68 boundslat(:, :) = boundslat_(:, :) 70 69 cell_area(:) = cell_area_(:) 71 70 IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) 72 71 IF (PRESENT(dx_)) dx(:) = dx_(:) 73 72 IF (PRESENT(dy_)) dy(:) = dy_(:) 74 73 75 74 END SUBROUTINE init_geometry 76 75 77 76 78 END MODULE geometry_mod 79 77 END MODULE lmdz_geometry -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_init_print_control.F90
r5111 r5112 1 MODULE init_print_control_mod1 MODULE lmdz_init_print_control 2 2 3 ! init_print_control to initialize print_control_modvariables4 ! not included there because of circular dependecy issues3 ! init_print_control to initialize lmdz_print_control variables 4 ! not included there because of circular dependecy issues 5 5 6 6 CONTAINS 7 7 8 8 SUBROUTINE init_print_control 9 USE print_control_mod, ONLY: set_print_control10 USE ioipsl_getin_p_mod, ONLY: getin_p11 USE lmdz_phys_para, ONLY: is_omp_root, is_master12 IMPLICIT NONE9 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 13 13 14 14 INTEGER :: lunout ! default output file identifier (6==screen) … … 17 17 LOGICAL :: opened 18 18 INTEGER :: number 19 19 20 20 !Config Key = prt_level 21 21 !Config Desc = niveau d'impressions de débogage … … 24 24 !Config (0 = minimum d'impression) 25 25 prt_level = 0 26 CALL getin_p('prt_level', prt_level)26 CALL getin_p('prt_level', prt_level) 27 27 28 28 !Config Key = lunout … … 31 31 !Config Help = unite de fichier pour les impressions 32 32 !Config (defaut sortie standard = 6) 33 lunout =633 lunout = 6 34 34 CALL getin_p('lunout', lunout) 35 35 36 36 IF (is_omp_root) THEN 37 37 IF (lunout /= 5 .and. lunout /= 6) THEN 38 INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)39 40 lunout=number41 42 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',&43 STATUS='unknown',FORM='formatted')44 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 45 45 ENDIF 46 46 ENDIF … … 52 52 53 53 debug = .FALSE. 54 CALL getin_p('debug', debug)55 54 CALL getin_p('debug', debug) 55 56 56 IF (is_master) THEN 57 WRITE(lunout, *)"init_print_control: prt_level=",prt_level58 WRITE(lunout, *)"init_print_control: lunout=",lunout59 WRITE(lunout, *)"init_print_control: debug=",debug57 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 60 60 ENDIF 61 62 CALL set_print_control(lunout,prt_level,debug)63 61 64 END SUBROUTINE init_print_control62 CALL set_print_control(lunout, prt_level, debug) 65 63 66 END MODULE init_print_control_mod 64 END SUBROUTINE init_print_control 67 65 66 END MODULE lmdz_init_print_control 67 -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_ioipsl_getin_p.F90
r5111 r5112 1 2 1 ! $Id$ 3 2 4 MODULE ioipsl_getin_p_mod5 ! To use getin in a parallel context6 !---------------------------------------------------------------------7 USE ioipsl, ONLY: getin8 USE lmdz_phys_mpi_data, ONLY:is_mpi_root9 USE lmdz_phys_omp_data, ONLY:is_omp_root10 USE lmdz_phys_transfert_para, ONLY: bcast11 !-12 IMPLICIT NONE13 !-14 PRIVATE15 PUBLIC :: getin_p16 !-17 INTERFACE getin_p3 MODULE 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 18 17 19 MODULE PROCEDURE getinrs_p, getinr1d_p, getinr2d_p, &20 21 getincs_p,&22 23 END INTERFACE24 !-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 !- 25 24 CONTAINS 26 25 27 26 28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!29 !! Definition des getin -> bcast !!30 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!27 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 28 !! Definition des getin -> bcast !! 29 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 31 30 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 -- !! 38 32 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 40 39 IF (is_mpi_root .AND. is_omp_root) THEN 41 CALL getin(VarIn,VarOut)40 CALL getin(VarIn, VarOut) 42 41 ENDIF 43 42 CALL bcast(VarOut) 44 43 END SUBROUTINE getincs_p 45 44 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 -- !! 52 46 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 54 53 IF (is_mpi_root .AND. is_omp_root) THEN 55 CALL getin(VarIn,VarOut)54 CALL getin(VarIn, VarOut) 56 55 ENDIF 57 56 CALL bcast(VarOut) 58 57 END SUBROUTINE getinis_p 59 58 60 SUBROUTINE getini1d_p(VarIn, VarOut)61 IMPLICIT NONE 62 CHARACTER(LEN =*),INTENT(IN) :: VarIn63 INTEGER, INTENT(INOUT) :: VarOut(:)59 SUBROUTINE getini1d_p(VarIn, VarOut) 60 IMPLICIT NONE 61 CHARACTER(LEN = *), INTENT(IN) :: VarIn 62 INTEGER, INTENT(INOUT) :: VarOut(:) 64 63 65 !$OMP BARRIER64 !$OMP BARRIER 66 65 IF (is_mpi_root .AND. is_omp_root) THEN 67 CALL getin(VarIn,VarOut)66 CALL getin(VarIn, VarOut) 68 67 ENDIF 69 68 CALL bcast(VarOut) 70 69 END SUBROUTINE getini1d_p 71 70 72 SUBROUTINE getini2d_p(VarIn, VarOut)73 IMPLICIT NONE 74 CHARACTER(LEN =*),INTENT(IN) :: VarIn75 INTEGER, INTENT(INOUT) :: VarOut(:,:)71 SUBROUTINE getini2d_p(VarIn, VarOut) 72 IMPLICIT NONE 73 CHARACTER(LEN = *), INTENT(IN) :: VarIn 74 INTEGER, INTENT(INOUT) :: VarOut(:, :) 76 75 77 !$OMP BARRIER76 !$OMP BARRIER 78 77 IF (is_mpi_root .AND. is_omp_root) THEN 79 CALL getin(VarIn,VarOut)78 CALL getin(VarIn, VarOut) 80 79 ENDIF 81 80 CALL bcast(VarOut) 82 81 END SUBROUTINE getini2d_p 83 82 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 -- !! 90 84 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 92 91 IF (is_mpi_root .AND. is_omp_root) THEN 93 CALL getin(VarIn,VarOut)92 CALL getin(VarIn, VarOut) 94 93 ENDIF 95 94 CALL bcast(VarOut) 96 95 END SUBROUTINE getinrs_p 97 96 98 SUBROUTINE getinr1d_p(VarIn, VarOut)99 IMPLICIT NONE 100 CHARACTER(LEN =*),INTENT(IN) :: VarIn101 REAL, INTENT(INOUT) :: VarOut(:)97 SUBROUTINE getinr1d_p(VarIn, VarOut) 98 IMPLICIT NONE 99 CHARACTER(LEN = *), INTENT(IN) :: VarIn 100 REAL, INTENT(INOUT) :: VarOut(:) 102 101 103 !$OMP BARRIER102 !$OMP BARRIER 104 103 IF (is_mpi_root .AND. is_omp_root) THEN 105 CALL getin(VarIn,VarOut)104 CALL getin(VarIn, VarOut) 106 105 ENDIF 107 106 CALL bcast(VarOut) 108 107 END SUBROUTINE getinr1d_p 109 108 110 SUBROUTINE getinr2d_p(VarIn, VarOut)111 IMPLICIT NONE 112 CHARACTER(LEN =*),INTENT(IN) :: VarIn113 REAL, INTENT(INOUT) :: VarOut(:,:)109 SUBROUTINE getinr2d_p(VarIn, VarOut) 110 IMPLICIT NONE 111 CHARACTER(LEN = *), INTENT(IN) :: VarIn 112 REAL, INTENT(INOUT) :: VarOut(:, :) 114 113 115 !$OMP BARRIER114 !$OMP BARRIER 116 115 IF (is_mpi_root .AND. is_omp_root) THEN 117 CALL getin(VarIn,VarOut)116 CALL getin(VarIn, VarOut) 118 117 ENDIF 119 118 CALL bcast(VarOut) 120 119 END SUBROUTINE getinr2d_p 121 120 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 -- !! 128 122 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 130 129 IF (is_mpi_root .AND. is_omp_root) THEN 131 CALL getin(VarIn,VarOut)130 CALL getin(VarIn, VarOut) 132 131 ENDIF 133 132 CALL bcast(VarOut) 134 133 END SUBROUTINE getinls_p 135 134 136 SUBROUTINE getinl1d_p(VarIn, VarOut)137 IMPLICIT NONE 138 CHARACTER(LEN =*),INTENT(IN) :: VarIn139 LOGICAL, INTENT(INOUT) :: VarOut(:)135 SUBROUTINE getinl1d_p(VarIn, VarOut) 136 IMPLICIT NONE 137 CHARACTER(LEN = *), INTENT(IN) :: VarIn 138 LOGICAL, INTENT(INOUT) :: VarOut(:) 140 139 141 !$OMP BARRIER140 !$OMP BARRIER 142 141 IF (is_mpi_root .AND. is_omp_root) THEN 143 CALL getin(VarIn,VarOut)142 CALL getin(VarIn, VarOut) 144 143 ENDIF 145 144 CALL bcast(VarOut) 146 145 END SUBROUTINE getinl1d_p 147 146 148 SUBROUTINE getinl2d_p(VarIn, VarOut)149 IMPLICIT NONE 150 CHARACTER(LEN =*),INTENT(IN) :: VarIn151 LOGICAL, INTENT(INOUT) :: VarOut(:,:)147 SUBROUTINE getinl2d_p(VarIn, VarOut) 148 IMPLICIT NONE 149 CHARACTER(LEN = *), INTENT(IN) :: VarIn 150 LOGICAL, INTENT(INOUT) :: VarOut(:, :) 152 151 153 !$OMP BARRIER152 !$OMP BARRIER 154 153 IF (is_mpi_root .AND. is_omp_root) THEN 155 CALL getin(VarIn,VarOut)154 CALL getin(VarIn, VarOut) 156 155 ENDIF 157 156 CALL bcast(VarOut) 158 157 END SUBROUTINE getinl2d_p 159 !-160 !-----------------------------161 !-----------------------------162 !-----------------------------158 !- 159 !----------------------------- 160 !----------------------------- 161 !----------------------------- 163 162 164 END MODULE ioipsl_getin_p_mod163 END MODULE lmdz_ioipsl_getin_p 165 164 -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_mpi_data.F90
r5110 r5112 184 184 185 185 SUBROUTINE print_module_data 186 USE print_control_mod, ONLY: lunout186 USE lmdz_print_control, ONLY: lunout 187 187 IMPLICIT NONE 188 188 ! INCLUDE "iniprint.h" -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_data.F90
r5111 r5112 108 108 109 109 SUBROUTINE Print_module_data 110 USE print_control_mod, ONLY: lunout110 USE lmdz_print_control, ONLY: lunout 111 111 IMPLICIT NONE 112 112 ! INCLUDE "iniprint.h" -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_para.f90
r5110 r5112 52 52 SUBROUTINE Test_transfert 53 53 USE lmdz_grid_phy 54 USE print_control_mod, ONLY: lunout54 USE lmdz_print_control, ONLY: lunout 55 55 IMPLICIT NONE 56 56 ! INCLUDE "iniprint.h" -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_physics_distribution.F90
r5111 r5112 1 2 1 !$Id$ 3 2 4 MODULE physics_distribution_mod3 MODULE lmdz_physics_distribution 5 4 6 5 … … 8 7 9 8 SUBROUTINE init_physics_distribution(grid_type, nvertex, & 10 11 12 USE lmdz_phys_para, ONLY: init_phys_lmdz_para, klon_omp13 USE lmdz_grid_phy, ONLY: init_grid_phy_lmdz14 USE dimphy, ONLY: Init_dimphy15 USE infotrac_phy, ONLY: type_trac9 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 16 15 #ifdef REPROBUS 17 16 USE CHEM_REP, ONLY: Init_chem_rep_phys 18 17 #endif 19 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA20 IMPLICIT NONE21 INTEGER, INTENT(IN) :: grid_type22 INTEGER, INTENT(IN) :: nvertex23 INTEGER, INTENT(IN) :: nbp24 INTEGER, INTENT(IN) :: nbp_lon25 INTEGER, INTENT(IN) :: nbp_lat26 INTEGER, INTENT(IN) :: nbp_lev27 INTEGER, INTENT(IN) :: communicator18 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 28 27 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) 29 32 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 38 36 39 37 #ifdef REPROBUS … … 42 40 #endif 43 41 44 !$OMP END PARALLEL42 !$OMP END PARALLEL 45 43 46 END SUBROUTINE init_physics_distribution 44 END SUBROUTINE init_physics_distribution 47 45 48 !SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)49 ! USE lmdz_phys_para, ONLY: Init_phys_lmdz_para!, klon_omp50 ! USE lmdz_grid_phy, ONLY: Init_grid_phy_lmdz!, nbp_lev51 ! USE dimphy, ONLY: Init_dimphy52 ! USE infotrac_phy, ONLY: type_trac53 !#ifdef REPROBUS54 ! USE CHEM_REP, ONLY: Init_chem_rep_phys55 !#endif46 !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 56 54 57 ! IMPLICIT NONE58 59 ! INTEGER,INTENT(in) :: iim60 ! INTEGER,INTENT(in) :: jjp161 ! INTEGER,INTENT(in) :: llm62 ! INTEGER,INTENT(in) :: nb_proc63 ! 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) 64 62 65 63 66 ! CALL Init_grid_phy_lmdz(iim,jjp1,llm)67 ! CALL Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)68 !!$OMP PARALLEL69 ! 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) 70 68 71 !#ifdef REPROBUS72 !! Initialization of Reprobus73 ! IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev)74 ! END IF75 !#endif69 !#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 76 74 77 !!$OMP END PARALLEL78 79 !END SUBROUTINE Init_Phys_lmdz 75 !!$OMP END PARALLEL 76 77 !END SUBROUTINE Init_Phys_lmdz 80 78 81 79 80 END MODULE lmdz_physics_distribution 82 81 83 84 85 86 87 88 END MODULE physics_distribution_mod89 -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_print_control.f90
r5111 r5112 1 1 ! $Id: $ 2 MODULE print_control_mod2 MODULE lmdz_print_control 3 3 4 INTEGER, SAVE :: lunout ! default output file identifier (6==screen)5 INTEGER, SAVE :: prt_level ! debug output level6 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 only8 LOGICAL, SAVE :: call_alert ! (combination of is_master and alert_first_CALL for easier use9 !$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) 10 10 11 11 ! NB: Module variable Initializations done by set_print_control 12 ! routine from init_print_control_modto avoid circular12 ! routine from lmdz_init_print_control to avoid circular 13 13 ! module dependencies 14 14 15 15 CONTAINS 16 16 17 SUBROUTINE set_print_control(lunout_, prt_level_,debug_)18 IMPLICIT NONE17 SUBROUTINE set_print_control(lunout_, prt_level_, debug_) 18 IMPLICIT NONE 19 19 INTEGER, INTENT(IN) :: lunout_ 20 20 INTEGER, INTENT(IN) :: prt_level_ 21 21 LOGICAL, INTENT(IN) :: debug_ 22 22 23 23 lunout = lunout_ 24 24 prt_level = prt_level_ 25 25 debug = debug_ 26 26 27 27 END SUBROUTINE set_print_control 28 28 … … 35 35 ! modname: module/routine name 36 36 ! niv_alerte: alert level (0/1/2) 37 CHARACTER(LEN =*), INTENT(IN) :: modname38 CHARACTER(LEN =*) :: message37 CHARACTER(LEN = *), INTENT(IN) :: modname 38 CHARACTER(LEN = *) :: message 39 39 INTEGER :: niv_alerte 40 40 ! local variables 41 CHARACTER(LEN =7), DIMENSION(0:2) :: alarm_color = (/ 'VERTE ','ORANGE ','ROUGE ' /)42 CHARACTER(LEN =7) :: alarm_couleur43 INTEGER :: alarm_file =15 ! in case we want/need to print out the special alarms in a separate file41 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 44 44 45 IF ( 46 IF ( alarm_file /= lunout) THEN47 48 45 IF (alert_first_call) then 46 IF (alarm_file /= lunout) THEN 47 OPEN(unit = alarm_file, file = "ALERTES.txt") 48 ENDIF 49 49 ENDIF 50 50 51 51 alarm_couleur = alarm_color(niv_alerte) 52 52 IF (niv_alerte < 0 .OR. niv_alerte > 3) then 53 message = 'NIVEAU ALERTE INVALIDE '//message54 alarm_couleur='NOIRE '53 message = 'NIVEAU ALERTE INVALIDE ' // message 54 alarm_couleur = 'NOIRE ' 55 55 ENDIF 56 56 57 WRITE(alarm_file, *)' ALERTE ', alarm_couleur, trim(modname),trim(message)58 57 WRITE(alarm_file, *)' ALERTE ', alarm_couleur, trim(modname), trim(message) 58 59 59 END SUBROUTINE prt_alerte 60 60 61 62 END MODULE print_control_mod61 62 END MODULE lmdz_print_control -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_regular_lonlat.f90
r5111 r5112 1 MODULE regular_lonlat_mod1 MODULE lmdz_regular_lonlat 2 2 3 3 ! Store information on the global physics grid … … 52 52 END SUBROUTINE init_regular_lonlat 53 53 54 END MODULE regular_lonlat_mod54 END MODULE lmdz_regular_lonlat 55 55 -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_vertical_layers.f90
r5111 r5112 1 ! $Id: $ 2 3 MODULE vertical_layers_mod 1 MODULE lmdz_vertical_layers 4 2 5 3 REAL,SAVE :: preff ! reference surface pressure (Pa) 6 4 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 8 6 ! at layer interfaces (Pa) 9 REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid (sigma contribution) coordinate 7 REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid (sigma contribution) coordinate 10 8 ! at layer interfaces (Pa) 11 REAL,SAVE,ALLOCATABLE :: aps(:) ! hybrid (pressure contribution) coordinate 9 REAL,SAVE,ALLOCATABLE :: aps(:) ! hybrid (pressure contribution) coordinate 12 10 ! at mid-layer (Pa) 13 REAL,SAVE,ALLOCATABLE :: bps(:) ! hybrid (sigma contribution) coordinate 11 REAL,SAVE,ALLOCATABLE :: bps(:) ! hybrid (sigma contribution) coordinate 14 12 ! at mid-layer 15 13 REAL,SAVE,ALLOCATABLE :: presnivs(:) ! reference pressure at mid-layer (Pa), … … 19 17 REAL,SAVE,ALLOCATABLE :: pseudoalt(:) ! pseudo-altitude of model layers (km), 20 18 ! based on preff and scaleheight 21 19 22 20 !$OMP THREADPRIVATE(preff,scaleheight,ap,bp,aps,bps,presnivs,presinter,pseudoalt) 23 21 … … 38 36 REAL,INTENT(IN) :: presinter_(nlayer+1) ! Appproximative pressure of atm. layers (Pa) 39 37 REAL,INTENT(IN) :: pseudoalt_(nlayer) ! pseudo-altitude of atm. layers (km) 40 38 41 39 ALLOCATE(ap(nlayer+1)) 42 40 ALLOCATE(bp(nlayer+1)) … … 46 44 ALLOCATE(presinter(nlayer+1)) 47 45 ALLOCATE(pseudoalt(nlayer)) 48 46 49 47 preff = preff_ 50 48 scaleheight=scaleheight_ … … 59 57 END SUBROUTINE init_vertical_layers 60 58 61 END MODULE vertical_layers_mod59 END MODULE lmdz_vertical_layers -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_write_field_phy.f90
r5111 r5112 1 2 1 ! $Id$ 3 2 4 MODULE write_field_phy3 MODULE lmdz_write_field_phy 5 4 6 5 ! 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 7 CONTAINS 8 9 SUBROUTINE WriteField_phy(name, Field, ll) 11 10 USE lmdz_phys_para, ONLY: klon_omp, is_mpi_root, & 12 11 Gather 13 12 USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat, klon_glo, & 14 13 Grid1Dto2D_glo 15 14 USE Write_Field, ONLY: WriteField 16 15 17 16 IMPLICIT NONE 18 17 19 CHARACTER(len =*),INTENT(IN) :: name20 INTEGER, INTENT(IN) :: ll21 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) 22 21 23 real, dimension(klon_glo, ll):: New_Field24 real, dimension(nbp_lon, nbp_lat,ll):: Field_2d22 real, dimension(klon_glo, ll) :: New_Field 23 real, dimension(nbp_lon, nbp_lat, ll) :: Field_2d 25 24 26 CALL Gather(Field, New_Field)27 !$OMP MASTER28 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) 31 30 ENDIF 32 !$OMP END MASTER31 !$OMP END MASTER 33 32 34 35 END SUBROUTINE WriteField_phy 36 37 END MODULE write_field_phy 33 END SUBROUTINE WriteField_phy 34 35 END MODULE lmdz_write_field_phy
Note: See TracChangeset
for help on using the changeset viewer.