[532] | 1 | MODULE cpl_oasis3 |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE cpl_oasis *** |
---|
[4990] | 4 | !! Coupled O/A : coupled ocean-atmosphere case using OASIS3-MCT |
---|
[532] | 5 | !!===================================================================== |
---|
| 6 | !! History : |
---|
[2715] | 7 | !! 9.0 ! 04-06 (R. Redler, NEC Laboratories Europe, Germany) Original code |
---|
| 8 | !! " " ! 04-11 (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Germany) revision |
---|
[532] | 9 | !! " " ! 04-11 (V. Gayler, MPI M&D) Grid writing |
---|
| 10 | !! " " ! 05-08 (R. Redler, W. Park) frld initialization, paral(2) revision |
---|
| 11 | !! " " ! 05-09 (R. Redler) extended to allow for communication over root only |
---|
| 12 | !! " " ! 06-01 (W. Park) modification of physical part |
---|
| 13 | !! " " ! 06-02 (R. Redler, W. Park) buffer array fix for root exchange |
---|
[3294] | 14 | !! 3.4 ! 11-11 (C. Harris) Changes to allow mutiple category fields |
---|
[532] | 15 | !!---------------------------------------------------------------------- |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
[5407] | 17 | !! 'key_oasis3' coupled Ocean/Atmosphere via OASIS3-MCT |
---|
| 18 | !! 'key_oa3mct_v3' to be added for OASIS3-MCT version 3 |
---|
[532] | 19 | !!---------------------------------------------------------------------- |
---|
[4990] | 20 | !! cpl_init : initialization of coupled mode communication |
---|
| 21 | !! cpl_define : definition of grid and fields |
---|
| 22 | !! cpl_snd : snd out fields in coupled mode |
---|
| 23 | !! cpl_rcv : receive fields in coupled mode |
---|
| 24 | !! cpl_finalize : finalize the coupled mode communication |
---|
[532] | 25 | !!---------------------------------------------------------------------- |
---|
[4990] | 26 | #if defined key_oasis3 |
---|
| 27 | USE mod_oasis ! OASIS3-MCT module |
---|
| 28 | #endif |
---|
[1218] | 29 | USE par_oce ! ocean parameters |
---|
[10269] | 30 | USE cpl_rnf_1d, ONLY: nn_cpl_river ! Variables used in 1D river outflow |
---|
[532] | 31 | USE dom_oce ! ocean space and time domain |
---|
| 32 | USE in_out_manager ! I/O manager |
---|
[2715] | 33 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[8280] | 34 | |
---|
[532] | 35 | IMPLICIT NONE |
---|
[1218] | 36 | PRIVATE |
---|
[10269] | 37 | |
---|
| 38 | #if ! defined key_oasis3 |
---|
| 39 | ! Dummy interface to oasis_get if not using oasis |
---|
| 40 | INTERFACE oasis_get |
---|
| 41 | MODULE PROCEDURE oasis_get_1d, oasis_get_2d |
---|
| 42 | END INTERFACE |
---|
| 43 | #endif |
---|
[532] | 44 | |
---|
[4990] | 45 | PUBLIC cpl_init |
---|
| 46 | PUBLIC cpl_define |
---|
| 47 | PUBLIC cpl_snd |
---|
| 48 | PUBLIC cpl_rcv |
---|
[10269] | 49 | PUBLIC cpl_rcv_1d |
---|
[4990] | 50 | PUBLIC cpl_freq |
---|
| 51 | PUBLIC cpl_finalize |
---|
[8280] | 52 | #if defined key_mpp_mpi |
---|
| 53 | INCLUDE 'mpif.h' |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | INTEGER, PARAMETER :: localRoot = 0 |
---|
| 57 | LOGICAL :: commRank ! true for ranks doing OASIS communication |
---|
| 58 | #if defined key_cpl_rootexchg |
---|
| 59 | LOGICAL :: rootexchg =.true. ! logical switch |
---|
| 60 | #else |
---|
| 61 | LOGICAL :: rootexchg =.false. ! logical switch |
---|
| 62 | #endif |
---|
[2715] | 63 | |
---|
| 64 | INTEGER, PUBLIC :: OASIS_Rcv = 1 !: return code if received field |
---|
| 65 | INTEGER, PUBLIC :: OASIS_idle = 0 !: return code if nothing done by oasis |
---|
[4990] | 66 | INTEGER :: ncomp_id ! id returned by oasis_init_comp |
---|
[2715] | 67 | INTEGER :: nerror ! return error code |
---|
[4990] | 68 | #if ! defined key_oasis3 |
---|
| 69 | ! OASIS Variables not used. defined only for compilation purpose |
---|
| 70 | INTEGER :: OASIS_Out = -1 |
---|
| 71 | INTEGER :: OASIS_REAL = -1 |
---|
| 72 | INTEGER :: OASIS_Ok = -1 |
---|
| 73 | INTEGER :: OASIS_In = -1 |
---|
| 74 | INTEGER :: OASIS_Sent = -1 |
---|
| 75 | INTEGER :: OASIS_SentOut = -1 |
---|
| 76 | INTEGER :: OASIS_ToRest = -1 |
---|
| 77 | INTEGER :: OASIS_ToRestOut = -1 |
---|
| 78 | INTEGER :: OASIS_Recvd = -1 |
---|
| 79 | INTEGER :: OASIS_RecvOut = -1 |
---|
| 80 | INTEGER :: OASIS_FromRest = -1 |
---|
| 81 | INTEGER :: OASIS_FromRestOut = -1 |
---|
| 82 | #endif |
---|
[2715] | 83 | |
---|
[5407] | 84 | INTEGER :: nrcv ! total number of fields received |
---|
| 85 | INTEGER :: nsnd ! total number of fields sent |
---|
| 86 | INTEGER :: ncplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data |
---|
| 87 | INTEGER, PUBLIC, PARAMETER :: nmaxfld=50 ! Maximum number of coupling fields |
---|
[4990] | 88 | INTEGER, PUBLIC, PARAMETER :: nmaxcat=5 ! Maximum number of coupling fields |
---|
| 89 | INTEGER, PUBLIC, PARAMETER :: nmaxcpl=5 ! Maximum number of coupling fields |
---|
[1218] | 90 | |
---|
[3294] | 91 | TYPE, PUBLIC :: FLD_CPL !: Type for coupling field information |
---|
| 92 | LOGICAL :: laction ! To be coupled or not |
---|
| 93 | CHARACTER(len = 8) :: clname ! Name of the coupling field |
---|
| 94 | CHARACTER(len = 1) :: clgrid ! Grid type |
---|
| 95 | REAL(wp) :: nsgn ! Control of the sign change |
---|
[4990] | 96 | INTEGER, DIMENSION(nmaxcat,nmaxcpl) :: nid ! Id of the field (no more than 9 categories and 9 extrena models) |
---|
[3294] | 97 | INTEGER :: nct ! Number of categories in field |
---|
[4990] | 98 | INTEGER :: ncplmodel ! Maximum number of models to/from which this variable may be sent/received |
---|
[10269] | 99 | INTEGER :: dimensions ! Number of dimensions of coupling field |
---|
[1218] | 100 | END TYPE FLD_CPL |
---|
[532] | 101 | |
---|
[2715] | 102 | TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC :: srcv, ssnd !: Coupling fields |
---|
[532] | 103 | |
---|
[2715] | 104 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: exfld ! Temporary buffer for receiving |
---|
[8280] | 105 | INTEGER, PUBLIC :: localComm |
---|
| 106 | |
---|
[532] | 107 | !!---------------------------------------------------------------------- |
---|
[2528] | 108 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
| 109 | !! $Id$ |
---|
[2715] | 110 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[532] | 111 | !!---------------------------------------------------------------------- |
---|
| 112 | CONTAINS |
---|
| 113 | |
---|
[5407] | 114 | SUBROUTINE cpl_init( cd_modname, kl_comm ) |
---|
[532] | 115 | !!------------------------------------------------------------------- |
---|
[4990] | 116 | !! *** ROUTINE cpl_init *** |
---|
[532] | 117 | !! |
---|
| 118 | !! ** Purpose : Initialize coupled mode communication for ocean |
---|
| 119 | !! exchange between AGCM, OGCM and COUPLER. (OASIS3 software) |
---|
| 120 | !! |
---|
| 121 | !! ** Method : OASIS3 MPI communication |
---|
| 122 | !!-------------------------------------------------------------------- |
---|
[5407] | 123 | CHARACTER(len = *), INTENT(in) :: cd_modname ! model name as set in namcouple file |
---|
| 124 | INTEGER , INTENT(out) :: kl_comm ! local communicator of the model |
---|
[1226] | 125 | !!-------------------------------------------------------------------- |
---|
[1218] | 126 | |
---|
[1579] | 127 | ! WARNING: No write in numout in this routine |
---|
| 128 | !============================================ |
---|
| 129 | |
---|
[532] | 130 | !------------------------------------------------------------------ |
---|
[4990] | 131 | ! 1st Initialize the OASIS system for the application |
---|
[532] | 132 | !------------------------------------------------------------------ |
---|
[5407] | 133 | CALL oasis_init_comp ( ncomp_id, TRIM(cd_modname), nerror ) |
---|
[4990] | 134 | IF ( nerror /= OASIS_Ok ) & |
---|
| 135 | CALL oasis_abort (ncomp_id, 'cpl_init', 'Failure in oasis_init_comp') |
---|
[532] | 136 | |
---|
| 137 | !------------------------------------------------------------------ |
---|
| 138 | ! 3rd Get an MPI communicator for OPA local communication |
---|
| 139 | !------------------------------------------------------------------ |
---|
| 140 | |
---|
[4990] | 141 | CALL oasis_get_localcomm ( kl_comm, nerror ) |
---|
| 142 | IF ( nerror /= OASIS_Ok ) & |
---|
| 143 | CALL oasis_abort (ncomp_id, 'cpl_init','Failure in oasis_get_localcomm' ) |
---|
[8280] | 144 | localComm = kl_comm |
---|
[2715] | 145 | ! |
---|
[4990] | 146 | END SUBROUTINE cpl_init |
---|
[532] | 147 | |
---|
| 148 | |
---|
[4990] | 149 | SUBROUTINE cpl_define( krcv, ksnd, kcplmodel ) |
---|
[532] | 150 | !!------------------------------------------------------------------- |
---|
[4990] | 151 | !! *** ROUTINE cpl_define *** |
---|
[532] | 152 | !! |
---|
| 153 | !! ** Purpose : Define grid and field information for ocean |
---|
| 154 | !! exchange between AGCM, OGCM and COUPLER. (OASIS3 software) |
---|
| 155 | !! |
---|
| 156 | !! ** Method : OASIS3 MPI communication |
---|
| 157 | !!-------------------------------------------------------------------- |
---|
[2715] | 158 | INTEGER, INTENT(in) :: krcv, ksnd ! Number of received and sent coupling fields |
---|
[4990] | 159 | INTEGER, INTENT(in) :: kcplmodel ! Maximum number of models to/from which NEMO is potentialy sending/receiving data |
---|
[1226] | 160 | ! |
---|
[2715] | 161 | INTEGER :: id_part |
---|
[10269] | 162 | INTEGER :: id_part_0d ! Partition for 0d fields |
---|
| 163 | INTEGER :: id_part_rnf_1d ! Partition for 1d river outflow fields |
---|
| 164 | INTEGER :: id_part_temp ! Temperary partition used to choose either 0d or 1d partitions |
---|
[2715] | 165 | INTEGER :: paral(5) ! OASIS3 box partition |
---|
[10269] | 166 | INTEGER :: ishape(4) ! Shape of 2D arrays passed to PSMILe. |
---|
[10159] | 167 | ! Redundant from OASIS3-MCT vn4.0 onwards but required |
---|
[10269] | 168 | ! to satisfy interface and for backward compatibility. |
---|
| 169 | INTEGER :: ishape0d1d(2) ! Shape of 0D or 1D arrays passed to PSMILe. |
---|
[10159] | 170 | INTEGER :: var_nodims(2) ! Number of coupling field dimensions. |
---|
| 171 | ! var_nodims(1) is redundant from OASIS3-MCT vn4.0 onwards |
---|
| 172 | ! but retained for backward compatibility. |
---|
| 173 | ! var_nodims(2) is the number of fields in a bundle |
---|
| 174 | ! or 1 for unbundled fields (bundles are not yet catered for |
---|
| 175 | ! in NEMO hence we default to 1). |
---|
[4990] | 176 | INTEGER :: ji,jc,jm ! local loop indicees |
---|
| 177 | CHARACTER(LEN=64) :: zclname |
---|
| 178 | CHARACTER(LEN=2) :: cli2 |
---|
[532] | 179 | !!-------------------------------------------------------------------- |
---|
[1218] | 180 | |
---|
[532] | 181 | IF(lwp) WRITE(numout,*) |
---|
[4990] | 182 | IF(lwp) WRITE(numout,*) 'cpl_define : initialization in coupled ocean/atmosphere case' |
---|
[532] | 183 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' |
---|
| 184 | IF(lwp) WRITE(numout,*) |
---|
| 185 | |
---|
[5407] | 186 | ncplmodel = kcplmodel |
---|
[4990] | 187 | IF( kcplmodel > nmaxcpl ) THEN |
---|
[5407] | 188 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'ncplmodel is larger than nmaxcpl, increase nmaxcpl') ; RETURN |
---|
[4990] | 189 | ENDIF |
---|
[5407] | 190 | |
---|
| 191 | nrcv = krcv |
---|
| 192 | IF( nrcv > nmaxfld ) THEN |
---|
| 193 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'nrcv is larger than nmaxfld, increase nmaxfld') ; RETURN |
---|
| 194 | ENDIF |
---|
| 195 | |
---|
| 196 | nsnd = ksnd |
---|
| 197 | IF( nsnd > nmaxfld ) THEN |
---|
| 198 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'nsnd is larger than nmaxfld, increase nmaxfld') ; RETURN |
---|
| 199 | ENDIF |
---|
| 200 | |
---|
[532] | 201 | ! |
---|
| 202 | ! ... Define the shape for the area that excludes the halo |
---|
| 203 | ! For serial configuration (key_mpp_mpi not being active) |
---|
| 204 | ! nl* is set to the global values 1 and jp*glo. |
---|
| 205 | ! |
---|
[10159] | 206 | ishape(1) = 1 |
---|
| 207 | ishape(2) = nlei-nldi+1 |
---|
| 208 | ishape(3) = 1 |
---|
| 209 | ishape(4) = nlej-nldj+1 |
---|
| 210 | |
---|
[10269] | 211 | ishape0d1d(1) = 0 |
---|
| 212 | ishape0d1d(2) = 0 |
---|
[10159] | 213 | |
---|
[532] | 214 | ! |
---|
| 215 | ! ... Allocate memory for data exchange |
---|
| 216 | ! |
---|
[1218] | 217 | ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror) |
---|
[2715] | 218 | IF( nerror > 0 ) THEN |
---|
[4990] | 219 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld') ; RETURN |
---|
[8280] | 220 | ENDIF |
---|
[532] | 221 | ! |
---|
[1218] | 222 | ! ----------------------------------------------------------------- |
---|
| 223 | ! ... Define the partition |
---|
| 224 | ! ----------------------------------------------------------------- |
---|
[8280] | 225 | |
---|
[1218] | 226 | paral(1) = 2 ! box partitioning |
---|
| 227 | paral(2) = jpiglo * (nldj-1+njmpp-1) + (nldi-1+nimpp-1) ! NEMO lower left corner global offset |
---|
| 228 | paral(3) = nlei-nldi+1 ! local extent in i |
---|
| 229 | paral(4) = nlej-nldj+1 ! local extent in j |
---|
| 230 | paral(5) = jpiglo ! global extent in x |
---|
| 231 | |
---|
| 232 | IF( ln_ctl ) THEN |
---|
| 233 | WRITE(numout,*) ' multiexchg: paral (1:5)', paral |
---|
| 234 | WRITE(numout,*) ' multiexchg: jpi, jpj =', jpi, jpj |
---|
| 235 | WRITE(numout,*) ' multiexchg: nldi, nlei, nimpp =', nldi, nlei, nimpp |
---|
| 236 | WRITE(numout,*) ' multiexchg: nldj, nlej, njmpp =', nldj, nlej, njmpp |
---|
| 237 | ENDIF |
---|
| 238 | |
---|
[8280] | 239 | CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo) |
---|
[10269] | 240 | |
---|
| 241 | ! A special partition is needed for 0D fields |
---|
| 242 | |
---|
| 243 | paral(1) = 0 ! serial partitioning |
---|
| 244 | paral(2) = 0 |
---|
| 245 | IF ( nproc == 0) THEN |
---|
| 246 | paral(3) = 1 ! Size of array to couple (scalar) |
---|
| 247 | ELSE |
---|
| 248 | paral(3) = 0 ! Dummy size for PE's not involved |
---|
| 249 | END IF |
---|
| 250 | paral(4) = 0 |
---|
| 251 | paral(5) = 0 |
---|
| 252 | |
---|
| 253 | CALL oasis_def_partition ( id_part_0d, paral, nerror, 1 ) |
---|
| 254 | |
---|
| 255 | ! Another partition is needed for 1D river routing fields |
---|
| 256 | |
---|
| 257 | paral(1) = 0 ! serial partitioning |
---|
| 258 | paral(2) = 0 |
---|
| 259 | IF ( nproc == 0) THEN |
---|
| 260 | paral(3) = nn_cpl_river ! Size of array to couple (vector) |
---|
| 261 | ELSE |
---|
| 262 | paral(3) = 0 ! Dummy size for PE's not involved |
---|
| 263 | END IF |
---|
| 264 | paral(4) = 0 |
---|
| 265 | paral(5) = 0 |
---|
| 266 | |
---|
| 267 | |
---|
| 268 | CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, nn_cpl_river ) |
---|
| 269 | |
---|
[532] | 270 | ! |
---|
[1218] | 271 | ! ... Announce send variables. |
---|
[532] | 272 | ! |
---|
[4990] | 273 | ssnd(:)%ncplmodel = kcplmodel |
---|
| 274 | ! |
---|
[1226] | 275 | DO ji = 1, ksnd |
---|
[4990] | 276 | IF ( ssnd(ji)%laction ) THEN |
---|
| 277 | |
---|
| 278 | IF( ssnd(ji)%nct > nmaxcat ) THEN |
---|
| 279 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '// & |
---|
| 280 | & TRIM(ssnd(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' ) |
---|
| 281 | RETURN |
---|
| 282 | ENDIF |
---|
| 283 | |
---|
[3294] | 284 | DO jc = 1, ssnd(ji)%nct |
---|
[4990] | 285 | DO jm = 1, kcplmodel |
---|
| 286 | |
---|
| 287 | IF ( ssnd(ji)%nct .GT. 1 ) THEN |
---|
| 288 | WRITE(cli2,'(i2.2)') jc |
---|
| 289 | zclname = TRIM(ssnd(ji)%clname)//'_cat'//cli2 |
---|
| 290 | ELSE |
---|
| 291 | zclname = ssnd(ji)%clname |
---|
| 292 | ENDIF |
---|
| 293 | IF ( kcplmodel > 1 ) THEN |
---|
| 294 | WRITE(cli2,'(i2.2)') jm |
---|
| 295 | zclname = 'model'//cli2//'_'//TRIM(zclname) |
---|
| 296 | ENDIF |
---|
| 297 | #if defined key_agrif |
---|
| 298 | IF( agrif_fixed() /= 0 ) THEN |
---|
| 299 | zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) |
---|
| 300 | END IF |
---|
| 301 | #endif |
---|
| 302 | IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out |
---|
[10159] | 303 | |
---|
| 304 | ! |
---|
| 305 | ! ... Set the field dimension and bundle count |
---|
| 306 | var_nodims(1) = 2 |
---|
| 307 | var_nodims(2) = 1 ! Modify this value to cater for bundled fields. |
---|
| 308 | |
---|
| 309 | CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part , var_nodims, & |
---|
[4990] | 310 | & OASIS_Out , ishape , OASIS_REAL, nerror ) |
---|
| 311 | IF ( nerror /= OASIS_Ok ) THEN |
---|
| 312 | WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) |
---|
| 313 | CALL oasis_abort ( ssnd(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' ) |
---|
| 314 | ENDIF |
---|
| 315 | IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple" |
---|
| 316 | IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple" |
---|
| 317 | END DO |
---|
[3294] | 318 | END DO |
---|
[1218] | 319 | ENDIF |
---|
[8280] | 320 | END DO |
---|
[1218] | 321 | ! |
---|
| 322 | ! ... Announce received variables. |
---|
| 323 | ! |
---|
[4990] | 324 | srcv(:)%ncplmodel = kcplmodel |
---|
| 325 | ! |
---|
[1226] | 326 | DO ji = 1, krcv |
---|
[1218] | 327 | IF ( srcv(ji)%laction ) THEN |
---|
[4990] | 328 | |
---|
| 329 | IF( srcv(ji)%nct > nmaxcat ) THEN |
---|
| 330 | CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '// & |
---|
| 331 | & TRIM(srcv(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' ) |
---|
| 332 | RETURN |
---|
| 333 | ENDIF |
---|
| 334 | |
---|
[3294] | 335 | DO jc = 1, srcv(ji)%nct |
---|
[4990] | 336 | DO jm = 1, kcplmodel |
---|
| 337 | |
---|
| 338 | IF ( srcv(ji)%nct .GT. 1 ) THEN |
---|
| 339 | WRITE(cli2,'(i2.2)') jc |
---|
| 340 | zclname = TRIM(srcv(ji)%clname)//'_cat'//cli2 |
---|
| 341 | ELSE |
---|
| 342 | zclname = srcv(ji)%clname |
---|
| 343 | ENDIF |
---|
| 344 | IF ( kcplmodel > 1 ) THEN |
---|
| 345 | WRITE(cli2,'(i2.2)') jm |
---|
| 346 | zclname = 'model'//cli2//'_'//TRIM(zclname) |
---|
| 347 | ENDIF |
---|
| 348 | #if defined key_agrif |
---|
| 349 | IF( agrif_fixed() /= 0 ) THEN |
---|
| 350 | zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) |
---|
| 351 | END IF |
---|
| 352 | #endif |
---|
| 353 | IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In |
---|
[10269] | 354 | flush(numout) |
---|
[10159] | 355 | |
---|
[10269] | 356 | ! Define 0D (Greenland or Antarctic ice mass) or 1D (river outflow) coupling fields |
---|
| 357 | IF (srcv(ji)%dimensions <= 1) THEN |
---|
| 358 | var_nodims(1) = 1 |
---|
| 359 | var_nodims(2) = 1 ! Modify this value to cater for bundled fields. |
---|
| 360 | IF (nproc == 0) THEN |
---|
[10159] | 361 | |
---|
[10269] | 362 | IF (srcv(ji)%dimensions == 0) THEN |
---|
| 363 | |
---|
| 364 | ! If 0D then set temporary variables to 0D components |
---|
| 365 | id_part_temp = id_part_0d |
---|
| 366 | ishape0d1d(2) = 1 |
---|
| 367 | ELSE |
---|
| 368 | |
---|
| 369 | ! If 1D then set temporary variables to river outflow components |
---|
| 370 | id_part_temp = id_part_rnf_1d |
---|
| 371 | ishape0d1d(2)= nn_cpl_river |
---|
| 372 | |
---|
| 373 | END IF |
---|
| 374 | |
---|
| 375 | CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_temp , var_nodims, & |
---|
| 376 | OASIS_In , ishape0d1d(1:2) , OASIS_REAL, nerror ) |
---|
| 377 | ELSE |
---|
| 378 | ! Dummy call to keep OASIS3-MCT happy. |
---|
| 379 | CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_0d , var_nodims, & |
---|
| 380 | OASIS_In , ishape0d1d(1:2) , OASIS_REAL, nerror ) |
---|
| 381 | END IF |
---|
| 382 | ELSE |
---|
| 383 | ! It's a "normal" 2D (or pseudo 3D) coupling field. |
---|
| 384 | ! ... Set the field dimension and bundle count |
---|
| 385 | var_nodims(1) = 2 |
---|
| 386 | var_nodims(2) = 1 ! Modify this value to cater for bundled fields. |
---|
| 387 | |
---|
| 388 | CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part , var_nodims, & |
---|
| 389 | OASIS_In , ishape , OASIS_REAL, nerror ) |
---|
| 390 | ENDIF |
---|
| 391 | |
---|
[4990] | 392 | IF ( nerror /= OASIS_Ok ) THEN |
---|
| 393 | WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) |
---|
| 394 | CALL oasis_abort ( srcv(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' ) |
---|
| 395 | ENDIF |
---|
| 396 | IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple" |
---|
| 397 | IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple" |
---|
| 398 | |
---|
| 399 | END DO |
---|
[3294] | 400 | END DO |
---|
[1218] | 401 | ENDIF |
---|
| 402 | END DO |
---|
| 403 | |
---|
[532] | 404 | !------------------------------------------------------------------ |
---|
[1218] | 405 | ! End of definition phase |
---|
[532] | 406 | !------------------------------------------------------------------ |
---|
[1218] | 407 | |
---|
[4990] | 408 | CALL oasis_enddef(nerror) |
---|
| 409 | IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') |
---|
[2715] | 410 | ! |
---|
[4990] | 411 | END SUBROUTINE cpl_define |
---|
[1218] | 412 | |
---|
| 413 | |
---|
[4990] | 414 | SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo ) |
---|
[532] | 415 | !!--------------------------------------------------------------------- |
---|
[4990] | 416 | !! *** ROUTINE cpl_snd *** |
---|
[532] | 417 | !! |
---|
| 418 | !! ** Purpose : - At each coupling time-step,this routine sends fields |
---|
| 419 | !! like sst or ice cover to the coupler or remote application. |
---|
| 420 | !!---------------------------------------------------------------------- |
---|
[3294] | 421 | INTEGER , INTENT(in ) :: kid ! variable index in the array |
---|
| 422 | INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument |
---|
| 423 | INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds |
---|
| 424 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pdata |
---|
| 425 | !! |
---|
[4990] | 426 | INTEGER :: jc,jm ! local loop index |
---|
[532] | 427 | !!-------------------------------------------------------------------- |
---|
| 428 | ! |
---|
[1218] | 429 | ! snd data to OASIS3 |
---|
[532] | 430 | ! |
---|
[3294] | 431 | DO jc = 1, ssnd(kid)%nct |
---|
[4990] | 432 | DO jm = 1, ssnd(kid)%ncplmodel |
---|
| 433 | |
---|
| 434 | IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN |
---|
| 435 | CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo ) |
---|
| 436 | |
---|
| 437 | IF ( ln_ctl ) THEN |
---|
| 438 | IF ( kinfo == OASIS_Sent .OR. kinfo == OASIS_ToRest .OR. & |
---|
| 439 | & kinfo == OASIS_SentOut .OR. kinfo == OASIS_ToRestOut ) THEN |
---|
| 440 | WRITE(numout,*) '****************' |
---|
| 441 | WRITE(numout,*) 'oasis_put: Outgoing ', ssnd(kid)%clname |
---|
| 442 | WRITE(numout,*) 'oasis_put: ivarid ', ssnd(kid)%nid(jc,jm) |
---|
| 443 | WRITE(numout,*) 'oasis_put: kstep ', kstep |
---|
| 444 | WRITE(numout,*) 'oasis_put: info ', kinfo |
---|
| 445 | WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) |
---|
| 446 | WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) |
---|
| 447 | WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) |
---|
| 448 | WRITE(numout,*) '****************' |
---|
| 449 | ENDIF |
---|
| 450 | ENDIF |
---|
| 451 | |
---|
[3294] | 452 | ENDIF |
---|
[4990] | 453 | |
---|
| 454 | ENDDO |
---|
[3294] | 455 | ENDDO |
---|
[2715] | 456 | ! |
---|
[4990] | 457 | END SUBROUTINE cpl_snd |
---|
[532] | 458 | |
---|
| 459 | |
---|
[4990] | 460 | SUBROUTINE cpl_rcv( kid, kstep, pdata, pmask, kinfo ) |
---|
[532] | 461 | !!--------------------------------------------------------------------- |
---|
[4990] | 462 | !! *** ROUTINE cpl_rcv *** |
---|
[532] | 463 | !! |
---|
| 464 | !! ** Purpose : - At each coupling time-step,this routine receives fields |
---|
| 465 | !! like stresses and fluxes from the coupler or remote application. |
---|
| 466 | !!---------------------------------------------------------------------- |
---|
[3294] | 467 | INTEGER , INTENT(in ) :: kid ! variable index in the array |
---|
| 468 | INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds |
---|
| 469 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdata ! IN to keep the value if nothing is done |
---|
[4990] | 470 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: pmask ! coupling mask |
---|
[3294] | 471 | INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument |
---|
[532] | 472 | !! |
---|
[4990] | 473 | INTEGER :: jc,jm ! local loop index |
---|
| 474 | LOGICAL :: llaction, llfisrt |
---|
[1218] | 475 | !!-------------------------------------------------------------------- |
---|
[532] | 476 | ! |
---|
[1218] | 477 | ! receive local data from OASIS3 on every process |
---|
| 478 | ! |
---|
[4990] | 479 | kinfo = OASIS_idle |
---|
| 480 | ! |
---|
[3294] | 481 | DO jc = 1, srcv(kid)%nct |
---|
[4990] | 482 | llfisrt = .TRUE. |
---|
[532] | 483 | |
---|
[4990] | 484 | DO jm = 1, srcv(kid)%ncplmodel |
---|
| 485 | |
---|
| 486 | IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN |
---|
| 487 | |
---|
[8280] | 488 | CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) |
---|
[4990] | 489 | |
---|
| 490 | llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & |
---|
[10269] | 491 | & kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut |
---|
[4990] | 492 | |
---|
| 493 | IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) |
---|
| 494 | |
---|
| 495 | IF ( llaction ) THEN |
---|
| 496 | |
---|
| 497 | kinfo = OASIS_Rcv |
---|
| 498 | IF( llfisrt ) THEN |
---|
[8280] | 499 | pdata(nldi:nlei,nldj:nlej,jc) = exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) |
---|
[4990] | 500 | llfisrt = .FALSE. |
---|
| 501 | ELSE |
---|
| 502 | pdata(nldi:nlei,nldj:nlej,jc) = pdata(nldi:nlei,nldj:nlej,jc) + exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm) |
---|
| 503 | ENDIF |
---|
| 504 | |
---|
| 505 | IF ( ln_ctl ) THEN |
---|
| 506 | WRITE(numout,*) '****************' |
---|
| 507 | WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname |
---|
| 508 | WRITE(numout,*) 'oasis_get: ivarid ' , srcv(kid)%nid(jc,jm) |
---|
| 509 | WRITE(numout,*) 'oasis_get: kstep', kstep |
---|
| 510 | WRITE(numout,*) 'oasis_get: info ', kinfo |
---|
| 511 | WRITE(numout,*) ' - Minimum value is ', MINVAL(pdata(:,:,jc)) |
---|
| 512 | WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:,:,jc)) |
---|
| 513 | WRITE(numout,*) ' - Sum value is ', SUM(pdata(:,:,jc)) |
---|
| 514 | WRITE(numout,*) '****************' |
---|
| 515 | ENDIF |
---|
[10269] | 516 | |
---|
[4990] | 517 | ENDIF |
---|
[10269] | 518 | |
---|
[4990] | 519 | ENDIF |
---|
[3294] | 520 | |
---|
[4990] | 521 | ENDDO |
---|
[4806] | 522 | |
---|
[4990] | 523 | !--- Fill the overlap areas and extra hallows (mpp) |
---|
| 524 | !--- check periodicity conditions (all cases) |
---|
| 525 | IF( .not. llfisrt ) CALL lbc_lnk( pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) |
---|
| 526 | |
---|
[3294] | 527 | ENDDO |
---|
[2715] | 528 | ! |
---|
[4990] | 529 | END SUBROUTINE cpl_rcv |
---|
[532] | 530 | |
---|
[10269] | 531 | SUBROUTINE cpl_rcv_1d( kid, kstep, pdata, nitems, kinfo ) |
---|
| 532 | !!--------------------------------------------------------------------- |
---|
| 533 | !! *** ROUTINE cpl_rcv_1d *** |
---|
| 534 | !! |
---|
| 535 | !! ** Purpose : - A special version of cpl_rcv to deal exclusively with |
---|
| 536 | !! receipt of 0D or 1D fields. |
---|
| 537 | !! The fields are recieved into a 1D array buffer which is simply a |
---|
| 538 | !! dynamically sized sized array (which may be of size 1) |
---|
| 539 | !! of 0 dimensional fields. This allows us to pass miltiple 0D |
---|
| 540 | !! fields via a single put/get operation. |
---|
| 541 | !!---------------------------------------------------------------------- |
---|
| 542 | INTEGER , INTENT(in ) :: nitems ! Number of 0D items to recieve |
---|
| 543 | ! during this get operation. i.e. |
---|
| 544 | ! The size of the 1D array in which |
---|
| 545 | ! 0D items are passed. |
---|
| 546 | INTEGER , INTENT(in ) :: kid ! ID index of the incoming |
---|
| 547 | ! data. |
---|
| 548 | INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds |
---|
| 549 | REAL(wp), INTENT(inout) :: pdata(1:nitems) ! The original value(s), |
---|
| 550 | ! unchanged if nothing is |
---|
| 551 | ! received |
---|
| 552 | INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument |
---|
| 553 | !! |
---|
| 554 | REAL(wp) :: recvfld(1:nitems) ! Local receive field buffer |
---|
| 555 | INTEGER :: jc,jm ! local loop index |
---|
| 556 | INTEGER :: ierr |
---|
| 557 | LOGICAL :: llaction |
---|
| 558 | INTEGER :: MPI_WORKING_PRECISION |
---|
| 559 | INTEGER :: number_to_print |
---|
| 560 | !!-------------------------------------------------------------------- |
---|
| 561 | ! |
---|
| 562 | ! receive local data from OASIS3 on every process |
---|
| 563 | ! |
---|
| 564 | kinfo = OASIS_idle |
---|
| 565 | ! |
---|
| 566 | ! 0D and 1D fields won't have categories or any other form of "pseudo level" |
---|
| 567 | ! so we only cater for a single set of values and thus don't bother |
---|
| 568 | ! with a loop over the jc index |
---|
| 569 | jc = 1 |
---|
[532] | 570 | |
---|
[10269] | 571 | DO jm = 1, srcv(kid)%ncplmodel |
---|
| 572 | |
---|
| 573 | IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN |
---|
| 574 | |
---|
| 575 | IF ( ( srcv(kid)%dimensions <= 1) .AND. (nproc == 0) ) THEN |
---|
| 576 | ! Since there is no concept of data decomposition for zero |
---|
| 577 | ! dimension fields, they must only be exchanged through the master PE, |
---|
| 578 | ! unlike "normal" 2D field cases where every PE is involved. |
---|
| 579 | |
---|
| 580 | CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, recvfld, kinfo ) |
---|
| 581 | |
---|
| 582 | llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & |
---|
| 583 | kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut |
---|
| 584 | |
---|
| 585 | IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , & |
---|
| 586 | llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) |
---|
| 587 | |
---|
| 588 | IF ( llaction ) THEN |
---|
| 589 | |
---|
| 590 | kinfo = OASIS_Rcv |
---|
| 591 | pdata(1:nitems) = recvfld(1:nitems) |
---|
| 592 | |
---|
| 593 | IF ( ln_ctl ) THEN |
---|
| 594 | number_to_print = 10 |
---|
| 595 | IF ( nitems < number_to_print ) number_to_print = nitems |
---|
| 596 | WRITE(numout,*) '****************' |
---|
| 597 | WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname |
---|
| 598 | WRITE(numout,*) 'oasis_get: ivarid ' , srcv(kid)%nid(jc,jm) |
---|
| 599 | WRITE(numout,*) 'oasis_get: kstep', kstep |
---|
| 600 | WRITE(numout,*) 'oasis_get: info ', kinfo |
---|
| 601 | WRITE(numout,*) ' - Minimum Value is ', MINVAL(pdata(:)) |
---|
| 602 | WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:)) |
---|
| 603 | WRITE(numout,*) ' - Start of data is ', pdata(1:number_to_print) |
---|
| 604 | WRITE(numout,*) '****************' |
---|
| 605 | ENDIF |
---|
| 606 | |
---|
| 607 | ENDIF |
---|
| 608 | ENDIF |
---|
| 609 | ENDIF |
---|
| 610 | |
---|
| 611 | ENDDO |
---|
| 612 | |
---|
| 613 | ! Set the precision that we want to broadcast using MPI_BCAST |
---|
| 614 | SELECT CASE( wp ) |
---|
| 615 | CASE( sp ) |
---|
| 616 | MPI_WORKING_PRECISION = MPI_REAL ! Single precision |
---|
| 617 | CASE( dp ) |
---|
| 618 | MPI_WORKING_PRECISION = MPI_DOUBLE_PRECISION ! Double precision |
---|
| 619 | CASE default |
---|
| 620 | CALL oasis_abort( ncomp_id, "cpl_rcv_1d", "Could not find precision for coupling 0d or 1d field" ) |
---|
| 621 | END SELECT |
---|
| 622 | |
---|
| 623 | ! We have to broadcast (potentially) received values from PE 0 to all |
---|
| 624 | ! the others. If no new data has been received we're just |
---|
| 625 | ! broadcasting the existing values but there's no more efficient way |
---|
| 626 | ! to deal with that w/o NEMO adopting a UM-style test mechanism |
---|
| 627 | ! to determine active put/get timesteps. |
---|
| 628 | CALL mpi_bcast( pdata, nitems, MPI_WORKING_PRECISION, localRoot, mpi_comm_opa, ierr ) |
---|
| 629 | |
---|
| 630 | ! |
---|
| 631 | END SUBROUTINE cpl_rcv_1d |
---|
| 632 | |
---|
| 633 | |
---|
[5407] | 634 | INTEGER FUNCTION cpl_freq( cdfieldname ) |
---|
[2528] | 635 | !!--------------------------------------------------------------------- |
---|
[4990] | 636 | !! *** ROUTINE cpl_freq *** |
---|
[2528] | 637 | !! |
---|
| 638 | !! ** Purpose : - send back the coupling frequency for a particular field |
---|
| 639 | !!---------------------------------------------------------------------- |
---|
[5407] | 640 | CHARACTER(len = *), INTENT(in) :: cdfieldname ! field name as set in namcouple file |
---|
[4990] | 641 | !! |
---|
[5407] | 642 | INTEGER :: id |
---|
[4990] | 643 | INTEGER :: info |
---|
| 644 | INTEGER, DIMENSION(1) :: itmp |
---|
[5407] | 645 | INTEGER :: ji,jm ! local loop index |
---|
| 646 | INTEGER :: mop |
---|
[2715] | 647 | !!---------------------------------------------------------------------- |
---|
[5407] | 648 | cpl_freq = 0 ! defaut definition |
---|
| 649 | id = -1 ! defaut definition |
---|
[2715] | 650 | ! |
---|
[5407] | 651 | DO ji = 1, nsnd |
---|
| 652 | IF (ssnd(ji)%laction ) THEN |
---|
| 653 | DO jm = 1, ncplmodel |
---|
| 654 | IF( ssnd(ji)%nid(1,jm) /= -1 ) THEN |
---|
| 655 | IF( TRIM(cdfieldname) == TRIM(ssnd(ji)%clname) ) THEN |
---|
| 656 | id = ssnd(ji)%nid(1,jm) |
---|
| 657 | mop = OASIS_Out |
---|
| 658 | ENDIF |
---|
| 659 | ENDIF |
---|
| 660 | ENDDO |
---|
| 661 | ENDIF |
---|
| 662 | ENDDO |
---|
| 663 | DO ji = 1, nrcv |
---|
| 664 | IF (srcv(ji)%laction ) THEN |
---|
| 665 | DO jm = 1, ncplmodel |
---|
| 666 | IF( srcv(ji)%nid(1,jm) /= -1 ) THEN |
---|
| 667 | IF( TRIM(cdfieldname) == TRIM(srcv(ji)%clname) ) THEN |
---|
| 668 | id = srcv(ji)%nid(1,jm) |
---|
| 669 | mop = OASIS_In |
---|
| 670 | ENDIF |
---|
| 671 | ENDIF |
---|
| 672 | ENDDO |
---|
| 673 | ENDIF |
---|
| 674 | ENDDO |
---|
| 675 | ! |
---|
| 676 | IF( id /= -1 ) THEN |
---|
| 677 | #if defined key_oa3mct_v3 |
---|
| 678 | CALL oasis_get_freqs(id, mop, 1, itmp, info) |
---|
| 679 | #else |
---|
[8280] | 680 | #if defined key_oasis3 |
---|
| 681 | itmp(1) = namflddti( id ) |
---|
| 682 | #else |
---|
[5407] | 683 | CALL oasis_get_freqs(id, 1, itmp, info) |
---|
| 684 | #endif |
---|
[8280] | 685 | #endif |
---|
[5407] | 686 | cpl_freq = itmp(1) |
---|
| 687 | ENDIF |
---|
| 688 | ! |
---|
[4990] | 689 | END FUNCTION cpl_freq |
---|
[2528] | 690 | |
---|
| 691 | |
---|
[4990] | 692 | SUBROUTINE cpl_finalize |
---|
[532] | 693 | !!--------------------------------------------------------------------- |
---|
[4990] | 694 | !! *** ROUTINE cpl_finalize *** |
---|
[532] | 695 | !! |
---|
| 696 | !! ** Purpose : - Finalizes the coupling. If MPI_init has not been |
---|
[4990] | 697 | !! called explicitly before cpl_init it will also close |
---|
[532] | 698 | !! MPI communication. |
---|
| 699 | !!---------------------------------------------------------------------- |
---|
[2715] | 700 | ! |
---|
| 701 | DEALLOCATE( exfld ) |
---|
[4990] | 702 | IF (nstop == 0) THEN |
---|
| 703 | CALL oasis_terminate( nerror ) |
---|
| 704 | ELSE |
---|
| 705 | CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" ) |
---|
| 706 | ENDIF |
---|
[2715] | 707 | ! |
---|
[4990] | 708 | END SUBROUTINE cpl_finalize |
---|
[532] | 709 | |
---|
[4990] | 710 | #if ! defined key_oasis3 |
---|
| 711 | |
---|
[1218] | 712 | !!---------------------------------------------------------------------- |
---|
[4990] | 713 | !! No OASIS Library OASIS3 Dummy module... |
---|
[1218] | 714 | !!---------------------------------------------------------------------- |
---|
[4990] | 715 | |
---|
| 716 | SUBROUTINE oasis_init_comp(k1,cd1,k2) |
---|
| 717 | CHARACTER(*), INTENT(in ) :: cd1 |
---|
| 718 | INTEGER , INTENT( out) :: k1,k2 |
---|
| 719 | k1 = -1 ; k2 = -1 |
---|
| 720 | WRITE(numout,*) 'oasis_init_comp: Error you sould not be there...', cd1 |
---|
| 721 | END SUBROUTINE oasis_init_comp |
---|
| 722 | |
---|
| 723 | SUBROUTINE oasis_abort(k1,cd1,cd2) |
---|
| 724 | INTEGER , INTENT(in ) :: k1 |
---|
| 725 | CHARACTER(*), INTENT(in ) :: cd1,cd2 |
---|
| 726 | WRITE(numout,*) 'oasis_abort: Error you sould not be there...', cd1, cd2 |
---|
| 727 | END SUBROUTINE oasis_abort |
---|
| 728 | |
---|
| 729 | SUBROUTINE oasis_get_localcomm(k1,k2) |
---|
| 730 | INTEGER , INTENT( out) :: k1,k2 |
---|
| 731 | k1 = -1 ; k2 = -1 |
---|
| 732 | WRITE(numout,*) 'oasis_get_localcomm: Error you sould not be there...' |
---|
| 733 | END SUBROUTINE oasis_get_localcomm |
---|
| 734 | |
---|
[8280] | 735 | SUBROUTINE oasis_def_partition(k1,k2,k3,K4) |
---|
[4990] | 736 | INTEGER , INTENT( out) :: k1,k3 |
---|
| 737 | INTEGER , INTENT(in ) :: k2(5) |
---|
[8280] | 738 | INTEGER , OPTIONAL, INTENT(in ) :: k4 |
---|
[4990] | 739 | k1 = k2(1) ; k3 = k2(5) |
---|
| 740 | WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...' |
---|
| 741 | END SUBROUTINE oasis_def_partition |
---|
| 742 | |
---|
| 743 | SUBROUTINE oasis_def_var(k1,cd1,k2,k3,k4,k5,k6,k7) |
---|
| 744 | CHARACTER(*), INTENT(in ) :: cd1 |
---|
[10269] | 745 | INTEGER , INTENT(in ) :: k2,k3(2),k4,k5(*),k6 |
---|
[4990] | 746 | INTEGER , INTENT( out) :: k1,k7 |
---|
| 747 | k1 = -1 ; k7 = -1 |
---|
| 748 | WRITE(numout,*) 'oasis_def_var: Error you sould not be there...', cd1 |
---|
| 749 | END SUBROUTINE oasis_def_var |
---|
| 750 | |
---|
| 751 | SUBROUTINE oasis_enddef(k1) |
---|
| 752 | INTEGER , INTENT( out) :: k1 |
---|
| 753 | k1 = -1 |
---|
| 754 | WRITE(numout,*) 'oasis_enddef: Error you sould not be there...' |
---|
| 755 | END SUBROUTINE oasis_enddef |
---|
| 756 | |
---|
| 757 | SUBROUTINE oasis_put(k1,k2,p1,k3) |
---|
| 758 | REAL(wp), DIMENSION(:,:), INTENT(in ) :: p1 |
---|
| 759 | INTEGER , INTENT(in ) :: k1,k2 |
---|
| 760 | INTEGER , INTENT( out) :: k3 |
---|
| 761 | k3 = -1 |
---|
| 762 | WRITE(numout,*) 'oasis_put: Error you sould not be there...' |
---|
| 763 | END SUBROUTINE oasis_put |
---|
| 764 | |
---|
[10269] | 765 | SUBROUTINE oasis_get_1d(k1,k2,p1,k3) |
---|
| 766 | REAL(wp), DIMENSION(:) , INTENT( out) :: p1 |
---|
| 767 | INTEGER , INTENT(in ) :: k1,k2 |
---|
| 768 | INTEGER , INTENT( out) :: k3 |
---|
| 769 | p1(1) = -1. ; k3 = -1 |
---|
| 770 | WRITE(numout,*) 'oasis_get_1d: Error you sould not be there...' |
---|
| 771 | END SUBROUTINE oasis_get_1d |
---|
| 772 | |
---|
| 773 | SUBROUTINE oasis_get_2d(k1,k2,p1,k3) |
---|
[4990] | 774 | REAL(wp), DIMENSION(:,:), INTENT( out) :: p1 |
---|
| 775 | INTEGER , INTENT(in ) :: k1,k2 |
---|
| 776 | INTEGER , INTENT( out) :: k3 |
---|
| 777 | p1(1,1) = -1. ; k3 = -1 |
---|
[10269] | 778 | WRITE(numout,*) 'oasis_get_2d: Error you sould not be there...' |
---|
| 779 | END SUBROUTINE oasis_get_2d |
---|
[4990] | 780 | |
---|
| 781 | SUBROUTINE oasis_get_freqs(k1,k2,k3,k4) |
---|
| 782 | INTEGER , INTENT(in ) :: k1,k2 |
---|
| 783 | INTEGER, DIMENSION(1), INTENT( out) :: k3 |
---|
| 784 | INTEGER , INTENT( out) :: k4 |
---|
| 785 | k3(1) = k1 ; k4 = k2 |
---|
| 786 | WRITE(numout,*) 'oasis_get_freqs: Error you sould not be there...' |
---|
| 787 | END SUBROUTINE oasis_get_freqs |
---|
| 788 | |
---|
| 789 | SUBROUTINE oasis_terminate(k1) |
---|
| 790 | INTEGER , INTENT( out) :: k1 |
---|
| 791 | k1 = -1 |
---|
| 792 | WRITE(numout,*) 'oasis_terminate: Error you sould not be there...' |
---|
| 793 | END SUBROUTINE oasis_terminate |
---|
| 794 | |
---|
[532] | 795 | #endif |
---|
| 796 | |
---|
[2715] | 797 | !!===================================================================== |
---|
[532] | 798 | END MODULE cpl_oasis3 |
---|