Changeset 4830 for palm/trunk/SOURCE/pmc_general_mod.f90
- Timestamp:
- Jan 6, 2021 11:25:45 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_general_mod.f90
r4828 r4830 1 MODULE pmc_general 2 1 !> @file pmc_general_mod.f90 3 2 !--------------------------------------------------------------------------------------------------! 4 3 ! This file is part of the PALM model system. … … 18 17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 !21 19 ! Current revisions: 22 20 ! ----------------- … … 26 24 ! ----------------- 27 25 ! $Id$ 26 ! Reformatted to follow PALM coding standard 27 ! 28 ! 4828 2021-01-05 11:21:41Z Giersch 28 29 ! Interface pmc_sort removed. Subroutine description added. 29 30 ! … … 48 49 ! Initial revision by K. Ketelsen 49 50 ! 51 ! Authors: 52 ! -------- 53 !> @author Klaus Ketelsen (no affiliation) 54 ! 50 55 ! Description: 51 56 ! ------------ 52 ! 53 ! Structure definition and utilities of Palm Model Coupler 57 !> Structure definition and utilities of Palm Model Coupler 54 58 !--------------------------------------------------------------------------------------------------! 59 MODULE pmc_general 55 60 56 61 #if defined( __parallel ) … … 61 66 USE MPI 62 67 68 63 69 IMPLICIT NONE 64 70 65 66 PRIVATE 67 SAVE 68 69 INTEGER(iwp), PARAMETER, PUBLIC :: da_desclen = 8 !< 70 INTEGER(iwp), PARAMETER, PUBLIC :: da_namelen = 16 !< 71 INTEGER(iwp), PARAMETER, PUBLIC :: pmc_da_name_err = 10 !< 72 INTEGER(iwp), PARAMETER, PUBLIC :: pmc_max_models = 64 !< 73 INTEGER(iwp), PARAMETER, PUBLIC :: pmc_status_ok = 0 !< 74 INTEGER(iwp), PARAMETER, PUBLIC :: pmc_status_error = -1 !< 75 76 INTEGER(iwp), PUBLIC :: pmc_max_array !< max # of arrays which can be coupled 77 !< - will be determined dynamically in pmc_interface 78 79 80 TYPE, PUBLIC :: xy_ind !< pair of indices in horizontal plane 81 INTEGER(iwp) :: i 82 INTEGER(iwp) :: j 71 INTEGER(iwp) :: pmc_max_array !< max # of arrays which can be coupled 72 !< - will be determined dynamically in pmc_interface 73 74 INTEGER(iwp), PARAMETER :: da_desclen = 8 !< 75 INTEGER(iwp), PARAMETER :: da_namelen = 16 !< 76 INTEGER(iwp), PARAMETER :: pmc_da_name_err = 10 !< 77 INTEGER(iwp), PARAMETER :: pmc_max_models = 64 !< 78 INTEGER(iwp), PARAMETER :: pmc_status_ok = 0 !< 79 INTEGER(iwp), PARAMETER :: pmc_status_error = -1 !< 80 81 TYPE :: xy_ind !< pair of indices in horizontal plane 82 INTEGER(iwp) :: i !< 83 INTEGER(iwp) :: j !< 83 84 END TYPE 84 85 85 TYPE , PUBLIC:: arraydef86 TYPE :: arraydef 86 87 CHARACTER(LEN=da_namelen) :: Name !< name of array 87 88 … … 91 92 INTEGER(iwp) :: RecvSize !< size in receive buffer 92 93 INTEGER(iwp) :: SendSize !< size in send buffer 93 94 INTEGER(idp) :: RecvIndex !< index in receive buffer 95 INTEGER(idp) :: SendIndex !< index in send buffer 94 INTEGER(idp) :: RecvIndex !< index in receive buffer 95 INTEGER(idp) :: SendIndex !< index in send buffer 96 96 97 97 INTEGER(iwp), DIMENSION(4) :: a_dim !< size of dimensions … … 107 107 END TYPE arraydef 108 108 109 110 TYPE(arraydef), PUBLIC, POINTER :: next !< 111 112 113 TYPE, PUBLIC :: pedef 114 INTEGER(iwp) :: nr_arrays = 0 !< number of arrays which will be transfered 115 INTEGER(iwp) :: nrele !< number of elements, same for all arrays 109 TYPE :: pedef 110 INTEGER(iwp) :: nr_arrays = 0 !< number of arrays which will be transfered 111 INTEGER(iwp) :: nrele !< number of elements, same for all arrays 116 112 117 113 TYPE(arraydef), POINTER, DIMENSION(:) :: array_list !< list of data arrays to be transfered 118 TYPE(xy_ind), POINTER, DIMENSION(:) :: locInd !< xy index local array for remote PE 114 115 TYPE(xy_ind), POINTER, DIMENSION(:) :: locInd !< xy index local array for remote PE 119 116 END TYPE pedef 120 117 121 122 TYPE, PUBLIC :: childdef123 INTEGER(iwp) :: inter_ comm !< inter communicator model and child124 INTEGER(iwp) :: int er_npes !< number of PEs child model125 INTEGER(iwp) :: intra_ comm !< intra communicator model and child126 INTEGER(iwp) :: intra_rank !< rank within intra_comm127 INTEGER(iwp) :: model_ comm !< communicator ofthis model128 INTEGER(iwp) :: model_ npes !< number of PEsthis model129 INTEGER(i wp) :: model_rank !< rank of this model130 INTEGER(i dp) :: totalbuffersize !<131 INTEGER(iwp) :: win_parent_child !< MPI RMA for preparing data on parent AND child side 118 TYPE :: childdef 119 INTEGER(iwp) :: inter_comm !< inter communicator model and child 120 INTEGER(iwp) :: inter_npes !< number of PEs child model 121 INTEGER(iwp) :: intra_comm !< intra communicator model and child 122 INTEGER(iwp) :: intra_rank !< rank within intra_comm 123 INTEGER(iwp) :: model_comm !< communicator of this model 124 INTEGER(iwp) :: model_npes !< number of PEs this model 125 INTEGER(iwp) :: model_rank !< rank of this model 126 INTEGER(idp) :: totalbuffersize !< 127 INTEGER(iwp) :: win_parent_child !< MPI RMA for preparing data on parent AND child side 128 132 129 TYPE(pedef), DIMENSION(:), POINTER :: pes !< list of all child PEs 133 130 END TYPE childdef 134 131 135 136 TYPE, PUBLIC :: da_namedef !< data array name definition 132 TYPE :: da_namedef !< data array name definition 137 133 CHARACTER(LEN=da_desclen) :: childdesc !< child array description 138 134 CHARACTER(LEN=da_namelen) :: nameonchild !< name of array within child 139 135 CHARACTER(LEN=da_namelen) :: nameonparent !< name of array within parent 140 136 CHARACTER(LEN=da_desclen) :: parentdesc !< parent array description 141 INTEGER(iwp) :: couple_index !< unique number of array 137 138 INTEGER(iwp) :: couple_index !< unique number of array 142 139 END TYPE da_namedef 140 141 TYPE(arraydef), POINTER :: next !< 142 143 SAVE 144 145 PRIVATE 146 147 ! 148 !-- Public functions 149 PUBLIC pmc_g_setname 150 151 ! 152 !-- Public variables, constants and types 153 PUBLIC arraydef, & 154 childdef, & 155 da_desclen, & 156 da_namedef, & 157 da_namelen, & 158 next, & 159 pedef, & 160 pmc_da_name_err, & 161 pmc_max_array, & 162 pmc_max_models, & 163 pmc_status_error, & 164 pmc_status_ok, & 165 xy_ind 143 166 144 167 INTERFACE pmc_g_setname … … 146 169 END INTERFACE pmc_g_setname 147 170 148 PUBLIC pmc_g_setname149 171 150 172 CONTAINS 173 151 174 152 175 !---------------------------------------------------------------------------------------------------! … … 157 180 SUBROUTINE pmc_g_setname( mychild, couple_index, aname ) 158 181 159 IMPLICIT NONE 160 161 CHARACTER(LEN=*) :: aname !< 162 163 INTEGER(iwp), INTENT(IN) :: couple_index !< 182 CHARACTER(LEN=*), INTENT(IN) :: aname !< 164 183 165 184 INTEGER(iwp) :: i !< 166 185 167 TYPE(childdef), INTENT(INOUT) :: mychild !< 168 169 TYPE(pedef), POINTER :: ape !< 186 INTEGER(iwp), INTENT(IN) :: couple_index !< 187 188 TYPE(childdef), INTENT(INOUT) :: mychild !< 189 190 TYPE(pedef), POINTER :: ape !< 191 170 192 171 193 ! … … 180 202 181 203 END SUBROUTINE pmc_g_setname 182 183 204 #endif 205 206 184 207 END MODULE pmc_general
Note: See TracChangeset
for help on using the changeset viewer.