Changeset 2715 for trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
- Timestamp:
- 2011-03-30T17:58:35+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
r2528 r2715 6 6 !!===================================================================== 7 7 !! History : 8 !! 9.0 ! 04-06 (R. Redler, NEC Laboratories Europe, St Augustin,Germany) Original code9 !! " " ! 04-11 (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Kiel,Germany) revision8 !! 9.0 ! 04-06 (R. Redler, NEC Laboratories Europe, Germany) Original code 9 !! " " ! 04-11 (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Germany) revision 10 10 !! " " ! 04-11 (V. Gayler, MPI M&D) Grid writing 11 11 !! " " ! 05-08 (R. Redler, W. Park) frld initialization, paral(2) revision … … 17 17 !!---------------------------------------------------------------------- 18 18 !! 'key_oasis3' coupled Ocean/Atmosphere via OASIS3 19 !!----------------------------------------------------------------------20 19 !!---------------------------------------------------------------------- 21 20 !! cpl_prism_init : initialization of coupled mode communication … … 33 32 USE dom_oce ! ocean space and time domain 34 33 USE in_out_manager ! I/O manager 35 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 34 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 35 36 36 IMPLICIT NONE 37 37 PRIVATE 38 ! 39 LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .TRUE. ! coupled flag 40 INTEGER, PUBLIC :: OASIS_Rcv = 1 ! return code if received field 41 INTEGER, PUBLIC :: OASIS_idle = 0 ! return code if nothing done by oasis 42 INTEGER :: ncomp_id ! id returned by prism_init_comp 43 INTEGER :: nerror ! return error code 44 45 INTEGER, PARAMETER :: nmaxfld=40 ! Maximum number of coupling fields 38 39 PUBLIC cpl_prism_init 40 PUBLIC cpl_prism_define 41 PUBLIC cpl_prism_snd 42 PUBLIC cpl_prism_rcv 43 PUBLIC cpl_prism_freq 44 PUBLIC cpl_prism_finalize 45 46 LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .TRUE. !: coupled flag 47 INTEGER, PUBLIC :: OASIS_Rcv = 1 !: return code if received field 48 INTEGER, PUBLIC :: OASIS_idle = 0 !: return code if nothing done by oasis 49 INTEGER :: ncomp_id ! id returned by prism_init_comp 50 INTEGER :: nerror ! return error code 51 52 INTEGER, PARAMETER :: nmaxfld=40 ! Maximum number of coupling fields 46 53 47 TYPE, PUBLIC :: FLD_CPL ! Type for coupling field information54 TYPE, PUBLIC :: FLD_CPL !: Type for coupling field information 48 55 LOGICAL :: laction ! To be coupled or not 49 56 CHARACTER(len = 8) :: clname ! Name of the coupling field … … 53 60 END TYPE FLD_CPL 54 61 55 TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC :: srcv, ssnd ! Coupling fields 56 57 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: exfld ! Temporary buffer for receiving 58 59 !! Routine accessibility 60 PUBLIC cpl_prism_init 61 PUBLIC cpl_prism_define 62 PUBLIC cpl_prism_snd 63 PUBLIC cpl_prism_rcv 64 PUBLIC cpl_prism_freq 65 PUBLIC cpl_prism_finalize 62 TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC :: srcv, ssnd !: Coupling fields 63 64 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: exfld ! Temporary buffer for receiving 66 65 67 66 !!---------------------------------------------------------------------- 68 67 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 69 68 !! $Id$ 70 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 71 !!---------------------------------------------------------------------- 72 69 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 70 !!---------------------------------------------------------------------- 73 71 CONTAINS 74 72 75 SUBROUTINE cpl_prism_init (kl_comm) 76 73 SUBROUTINE cpl_prism_init( kl_comm ) 77 74 !!------------------------------------------------------------------- 78 75 !! *** ROUTINE cpl_prism_init *** … … 83 80 !! ** Method : OASIS3 MPI communication 84 81 !!-------------------------------------------------------------------- 85 INTEGER, INTENT( OUT ) :: kl_comm! local communicator of the model82 INTEGER, INTENT(out) :: kl_comm ! local communicator of the model 86 83 !!-------------------------------------------------------------------- 87 84 … … 103 100 IF ( nerror /= PRISM_Ok ) & 104 101 CALL prism_abort_proto (ncomp_id, 'cpl_prism_init','Failure in prism_get_localcomm_proto' ) 105 102 ! 106 103 END SUBROUTINE cpl_prism_init 107 104 108 105 109 SUBROUTINE cpl_prism_define (krcv, ksnd) 110 106 SUBROUTINE cpl_prism_define( krcv, ksnd ) 111 107 !!------------------------------------------------------------------- 112 108 !! *** ROUTINE cpl_prism_define *** … … 117 113 !! ** Method : OASIS3 MPI communication 118 114 !!-------------------------------------------------------------------- 119 INTEGER, INTENT( IN ) :: krcv, ksnd ! Number of received and sent coupling fields 120 ! 121 INTEGER :: id_part 122 INTEGER :: paral(5) ! OASIS3 box partition 123 INTEGER :: ishape(2,2) ! shape of arrays passed to PSMILe 124 INTEGER :: ji ! local loop indicees 125 !! 115 INTEGER, INTENT(in) :: krcv, ksnd ! Number of received and sent coupling fields 116 ! 117 INTEGER :: id_part 118 INTEGER :: paral(5) ! OASIS3 box partition 119 INTEGER :: ishape(2,2) ! shape of arrays passed to PSMILe 120 INTEGER :: ji ! local loop indicees 126 121 !!-------------------------------------------------------------------- 127 122 … … 142 137 ! 143 138 ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror) 144 IF (nerror > 0) THEN 145 CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in allocating exfld') 146 RETURN 139 IF( nerror > 0 ) THEN 140 CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in allocating exfld') ; RETURN 147 141 ENDIF 148 142 ! … … 197 191 198 192 CALL prism_enddef_proto(nerror) 199 IF 200 193 IF( nerror /= PRISM_Ok ) CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef') 194 ! 201 195 END SUBROUTINE cpl_prism_define 202 196 203 197 204 198 SUBROUTINE cpl_prism_snd( kid, kstep, pdata, kinfo ) 205 206 199 !!--------------------------------------------------------------------- 207 200 !! *** ROUTINE cpl_prism_snd *** … … 210 203 !! like sst or ice cover to the coupler or remote application. 211 204 !!---------------------------------------------------------------------- 212 !! * Arguments 213 !! 214 INTEGER, INTENT( IN ) :: kid ! variable index in the array 215 INTEGER, INTENT( OUT ) :: kinfo ! OASIS3 info argument 216 INTEGER, INTENT( IN ) :: kstep ! ocean time-step in seconds 217 REAL(wp), DIMENSION(jpi,jpj), INTENT( IN ) :: pdata 218 !! 219 !! 205 INTEGER , INTENT(in ) :: kid ! variable index in the array 206 INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument 207 INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds 208 REAL(wp), DIMENSION(:,:), INTENT(in ) :: pdata 220 209 !!-------------------------------------------------------------------- 221 210 ! … … 236 225 WRITE(numout,*) ' - Sum value is ', SUM(pdata) 237 226 WRITE(numout,*) '****************' 238 ENDIF 239 ENDIF 227 ENDIF 228 ENDIF 229 ! 240 230 END SUBROUTINE cpl_prism_snd 241 231 242 232 243 233 SUBROUTINE cpl_prism_rcv( kid, kstep, pdata, kinfo ) 244 245 234 !!--------------------------------------------------------------------- 246 235 !! *** ROUTINE cpl_prism_rcv *** … … 249 238 !! like stresses and fluxes from the coupler or remote application. 250 239 !!---------------------------------------------------------------------- 251 INTEGER , INTENT( IN ) ::kid ! variable index in the array252 INTEGER , INTENT( IN ) ::kstep ! ocean time-step in seconds253 REAL(wp), DIMENSION( jpi,jpj), INTENT( INOUT ) ::pdata ! IN to keep the value if nothing is done254 INTEGER , INTENT( OUT ) ::kinfo ! OASIS3 info argument255 !! 256 LOGICAL ::llaction240 INTEGER , INTENT(in ) :: kid ! variable index in the array 241 INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds 242 REAL(wp), DIMENSION(:,:), INTENT(inout) :: pdata ! IN to keep the value if nothing is done 243 INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument 244 !! 245 LOGICAL :: llaction 257 246 !!-------------------------------------------------------------------- 258 247 ! … … 291 280 kinfo = OASIS_idle 292 281 ENDIF 293 282 ! 294 283 END SUBROUTINE cpl_prism_rcv 295 284 296 285 297 FUNCTION cpl_prism_freq( kid ) 298 286 INTEGER FUNCTION cpl_prism_freq( kid ) 299 287 !!--------------------------------------------------------------------- 300 288 !! *** ROUTINE cpl_prism_freq *** … … 302 290 !! ** Purpose : - send back the coupling frequency for a particular field 303 291 !!---------------------------------------------------------------------- 304 INTEGER,INTENT( IN ) :: kid! variable index305 INTEGER :: cpl_prism_freq ! coupling frequency292 INTEGER,INTENT(in) :: kid ! variable index 293 !!---------------------------------------------------------------------- 306 294 cpl_prism_freq = ig_def_freq( kid ) 307 295 ! 308 296 END FUNCTION cpl_prism_freq 309 297 310 298 311 299 SUBROUTINE cpl_prism_finalize 312 313 300 !!--------------------------------------------------------------------- 314 301 !! *** ROUTINE cpl_prism_finalize *** … … 318 305 !! MPI communication. 319 306 !!---------------------------------------------------------------------- 320 321 DEALLOCATE( exfld)322 CALL prism_terminate_proto 323 307 ! 308 DEALLOCATE( exfld ) 309 CALL prism_terminate_proto( nerror ) 310 ! 324 311 END SUBROUTINE cpl_prism_finalize 325 312 326 313 #else 327 328 !!---------------------------------------------------------------------- 329 !! Default case Forced Ocean/Atmosphere 330 !!---------------------------------------------------------------------- 331 !! Empty module 314 !!---------------------------------------------------------------------- 315 !! Default case Dummy module Forced Ocean/Atmosphere 332 316 !!---------------------------------------------------------------------- 333 317 USE in_out_manager ! I/O manager … … 335 319 PUBLIC cpl_prism_init 336 320 PUBLIC cpl_prism_finalize 337 338 321 CONTAINS 339 340 322 SUBROUTINE cpl_prism_init (kl_comm) 341 INTEGER, INTENT( OUT) :: kl_comm ! local communicator of the model323 INTEGER, INTENT(out) :: kl_comm ! local communicator of the model 342 324 kl_comm = -1 343 325 WRITE(numout,*) 'cpl_prism_init: Error you sould not be there...' 344 326 END SUBROUTINE cpl_prism_init 345 346 327 SUBROUTINE cpl_prism_finalize 347 328 WRITE(numout,*) 'cpl_prism_finalize: Error you sould not be there...' 348 329 END SUBROUTINE cpl_prism_finalize 349 350 330 #endif 351 331 332 !!===================================================================== 352 333 END MODULE cpl_oasis3
Note: See TracChangeset
for help on using the changeset viewer.