Changeset 10176
- Timestamp:
- 2018-10-05T17:57:31+02:00 (6 years ago)
- Location:
- branches/UKMO/dev_r5518_GO6_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_GO6_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
r10159 r10176 28 28 #endif 29 29 USE par_oce ! ocean parameters 30 USE cpl_rnf_1d, ONLY: nn_cpl_river ! Variables used in 1D river outflow 30 31 USE dom_oce ! ocean space and time domain 31 32 USE in_out_manager ! I/O manager … … 39 40 PUBLIC cpl_snd 40 41 PUBLIC cpl_rcv 42 PUBLIC cpl_rcv_1d 41 43 PUBLIC cpl_freq 42 44 PUBLIC cpl_finalize … … 88 90 INTEGER :: nct ! Number of categories in field 89 91 INTEGER :: ncplmodel ! Maximum number of models to/from which this variable may be sent/received 92 INTEGER :: dimensions ! Number of dimensions of coupling field 90 93 END TYPE FLD_CPL 91 94 … … 150 153 ! 151 154 INTEGER :: id_part 155 INTEGER :: id_part_0d ! Partition for 0d fields 156 INTEGER :: id_part_rnf_1d ! Partition for 1d river outflow fields 157 INTEGER :: id_part_temp ! Temperary partition used to choose either 0d or 1d partitions 158 INTEGER :: vector_length ! Length of 0d or 1d variables (0d variables will have vector_length=1) 152 159 INTEGER :: paral(5) ! OASIS3 box partition 153 160 INTEGER :: ishape(4) ! Shape of arrays passed to PSMILe. … … 222 229 223 230 CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo) 231 232 ! A special partition is needed for 0D fields 233 234 paral(1) = 0 ! serial partitioning 235 paral(2) = 0 236 IF ( nproc == 0) THEN 237 paral(3) = 1 ! Size of array to couple (scalar) 238 ELSE 239 paral(3) = 0 ! Dummy size for PE's not involved 240 END IF 241 paral(4) = 0 242 paral(5) = 0 243 244 CALL oasis_def_partition ( id_part_0d, paral, nerror, 1 ) 245 246 ! Another partition is needed for 1D river routing fields 247 248 paral(1) = 0 ! serial partitioning 249 paral(2) = 0 250 IF ( nproc == 0) THEN 251 paral(3) = nn_cpl_river ! Size of array to couple (vector) 252 ELSE 253 paral(3) = 0 ! Dummy size for PE's not involved 254 END IF 255 paral(4) = 0 256 paral(5) = 0 257 258 259 CALL oasis_def_partition ( id_part_rnf_1d, paral, nerror, nn_cpl_river ) 260 224 261 ! 225 262 ! ... Announce send variables. … … 306 343 #endif 307 344 IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In 308 309 ! ... Set the field dimension and bundle count 310 var_nodims(1) = 2 311 var_nodims(2) = 1 ! Modify this value to cater for bundled fields. 312 313 CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part , var_nodims, & 314 & OASIS_In , ishape , OASIS_REAL, nerror ) 345 flush(numout) 346 347 ! Define 0D (Greenland or Antarctic ice mass) or 1D (river outflow) coupling fields 348 IF (srcv(ji)%dimensions <= 1) THEN 349 var_nodims(1) = 1 350 var_nodims(2) = 1 ! Modify this value to cater for bundled fields. 351 IF (nproc == 0) THEN 352 353 IF (srcv(ji)%dimensions == 0) THEN 354 355 ! If 0D then set temporary variables to 0D components 356 id_part_temp = id_part_0d 357 vector_length = 1 358 ELSE 359 360 ! If 1D then set temporary variables to river outflow components 361 id_part_temp = id_part_rnf_1d 362 vector_length = nn_cpl_river 363 364 END IF 365 366 CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_temp , var_nodims, & 367 OASIS_In , (/ 1, vector_length /) , OASIS_REAL, nerror ) 368 ELSE 369 ! Dummy call to keep OASIS3-MCT happy. 370 CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part_0d , var_nodims, & 371 OASIS_In , (/ 0, 0 /) , OASIS_REAL, nerror ) 372 END IF 373 ELSE 374 ! It's a "normal" 2D (or pseudo 3D) coupling field. 375 ! ... Set the field dimension and bundle count 376 var_nodims(1) = 2 377 var_nodims(2) = 1 ! Modify this value to cater for bundled fields. 378 379 CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part , var_nodims, & 380 OASIS_In , ishape , OASIS_REAL, nerror ) 381 ENDIF 382 315 383 IF ( nerror /= OASIS_Ok ) THEN 316 384 WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) … … 412 480 413 481 llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & 414 482 & kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 415 483 416 484 IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) … … 437 505 WRITE(numout,*) '****************' 438 506 ENDIF 439 507 440 508 ENDIF 441 509 442 510 ENDIF 443 511 … … 451 519 ! 452 520 END SUBROUTINE cpl_rcv 521 522 SUBROUTINE cpl_rcv_1d( kid, kstep, pdata, nitems, kinfo ) 523 !!--------------------------------------------------------------------- 524 !! *** ROUTINE cpl_rcv_1d *** 525 !! 526 !! ** Purpose : - A special version of cpl_rcv to deal exclusively with 527 !! receipt of 0D or 1D fields. 528 !! The fields are recieved into a 1D array buffer which is simply a 529 !! dynamically sized sized array (which may be of size 1) 530 !! of 0 dimensional fields. This allows us to pass miltiple 0D 531 !! fields via a single put/get operation. 532 !!---------------------------------------------------------------------- 533 INTEGER , INTENT(in ) :: nitems ! Number of 0D items to recieve 534 ! during this get operation. i.e. 535 ! The size of the 1D array in which 536 ! 0D items are passed. 537 INTEGER , INTENT(in ) :: kid ! ID index of the incoming 538 ! data. 539 INTEGER , INTENT(in ) :: kstep ! ocean time-step in seconds 540 REAL(wp), INTENT(inout) :: pdata(1:nitems) ! The original value(s), 541 ! unchanged if nothing is 542 ! received 543 INTEGER , INTENT( out) :: kinfo ! OASIS3 info argument 544 !! 545 REAL(wp) :: recvfld(1:nitems) ! Local receive field buffer 546 INTEGER :: jc,jm ! local loop index 547 INTEGER :: ierr 548 LOGICAL :: llaction 549 INTEGER :: MPI_WORKING_PRECISION 550 INTEGER :: number_to_print 551 !!-------------------------------------------------------------------- 552 ! 553 ! receive local data from OASIS3 on every process 554 ! 555 kinfo = OASIS_idle 556 ! 557 ! 0D and 1D fields won't have categories or any other form of "pseudo level" 558 ! so we only cater for a single set of values and thus don't bother 559 ! with a loop over the jc index 560 jc = 1 561 562 DO jm = 1, srcv(kid)%ncplmodel 563 564 IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN 565 566 IF ( ( srcv(kid)%dimensions <= 1) .AND. (nproc == 0) ) THEN 567 ! Since there is no concept of data decomposition for zero 568 ! dimension fields, they must only be exchanged through the master PE, 569 ! unlike "normal" 2D field cases where every PE is involved. 570 571 CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, recvfld, kinfo ) 572 573 llaction = kinfo == OASIS_Recvd .OR. kinfo == OASIS_FromRest .OR. & 574 kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 575 576 IF ( ln_ctl ) WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , & 577 llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 578 579 IF ( llaction ) THEN 580 581 kinfo = OASIS_Rcv 582 pdata(1:nitems) = recvfld(1:nitems) 583 584 IF ( ln_ctl ) THEN 585 number_to_print = 10 586 IF ( nitems < number_to_print ) number_to_print = nitems 587 WRITE(numout,*) '****************' 588 WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname 589 WRITE(numout,*) 'oasis_get: ivarid ' , srcv(kid)%nid(jc,jm) 590 WRITE(numout,*) 'oasis_get: kstep', kstep 591 WRITE(numout,*) 'oasis_get: info ', kinfo 592 WRITE(numout,*) ' - Minimum Value is ', MINVAL(pdata(:)) 593 WRITE(numout,*) ' - Maximum value is ', MAXVAL(pdata(:)) 594 WRITE(numout,*) ' - Start of data is ', pdata(1:number_to_print) 595 WRITE(numout,*) '****************' 596 ENDIF 597 598 ENDIF 599 ENDIF 600 ENDIF 601 602 ENDDO 603 604 ! Set the precision that we want to broadcast using MPI_BCAST 605 SELECT CASE( wp ) 606 CASE( sp ) 607 MPI_WORKING_PRECISION = MPI_REAL ! Single precision 608 CASE( dp ) 609 MPI_WORKING_PRECISION = MPI_DOUBLE_PRECISION ! Double precision 610 CASE default 611 CALL oasis_abort( ncomp_id, "cpl_rcv_1d", "Could not find precision for coupling 0d or 1d field" ) 612 END SELECT 613 614 ! We have to broadcast (potentially) received values from PE 0 to all 615 ! the others. If no new data has been received we're just 616 ! broadcasting the existing values but there's no more efficient way 617 ! to deal with that w/o NEMO adopting a UM-style test mechanism 618 ! to determine active put/get timesteps. 619 CALL mpi_bcast( pdata, nitems, MPI_WORKING_PRECISION, localRoot, mpi_comm_opa, ierr ) 620 621 ! 622 END SUBROUTINE cpl_rcv_1d 453 623 454 624 -
branches/UKMO/dev_r5518_GO6_new_runoff_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
r9321 r10176 46 46 USE eosbn2 47 47 USE sbcrnf , ONLY : l_rnfcpl 48 USE cpl_rnf_1d, ONLY: nn_cpl_river, cpl_rnf_1d_init, cpl_rnf_1d_to_2d ! Variables used in 1D river outflow 48 49 #if defined key_cpl_carbon_cycle 49 50 USE p4zflx, ONLY : oce_co2 … … 111 112 INTEGER, PARAMETER :: jpr_atm_pco2 = 46 ! Incoming atm CO2 flux 112 113 INTEGER, PARAMETER :: jpr_atm_dust = 47 ! Incoming atm aggregate dust 113 INTEGER, PARAMETER :: jprcv = 47 ! total number of fields received 114 INTEGER, PARAMETER :: jpr_rnf_1d = 48 ! 1D river runoff 115 INTEGER, PARAMETER :: jprcv = 48 ! total number of fields received 114 116 115 117 INTEGER, PARAMETER :: jps_fice = 1 ! ice fraction sent to the atmosphere … … 175 177 LOGICAL :: ln_usecplmask ! use a coupling mask file to merge data received from several models 176 178 ! -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 179 177 180 TYPE :: DYNARR 178 181 REAL(wp), POINTER, DIMENSION(:,:,:) :: z3 … … 253 256 NAMELIST/namsbc_cpl/ sn_snd_bio_co2, sn_snd_bio_dms, sn_snd_bio_chloro, & 254 257 & sn_rcv_atm_pco2, sn_rcv_atm_dust 258 255 259 256 260 !!--------------------------------------------------------------------- … … 324 328 WRITE(numout,*)' rn_antarctica_calving_fraction = ', rn_antarctica_calving_fraction 325 329 WRITE(numout,*)' rn_iceshelf_fluxes_tolerance = ', rn_iceshelf_fluxes_tolerance 330 326 331 ENDIF 327 332 … … 339 344 340 345 ! default definitions of srcv 341 srcv(:)%laction = .FALSE. ; srcv(:)%clgrid = 'T' ; srcv(:)%nsgn = 1. ; srcv(:)%nct = 1 346 srcv(:)%laction = .FALSE. ; srcv(:)%clgrid = 'T' ; srcv(:)%nsgn = 1. ; srcv(:)%nct = 1 ; srcv(:)%dimensions = 2 342 347 343 348 ! ! ------------------------- ! … … 460 465 ! ! ------------------------- ! 461 466 srcv(jpr_rnf )%clname = 'O_Runoff' 462 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 463 srcv(jpr_rnf)%laction = .TRUE. 467 srcv(jpr_rnf_1d )%clname = 'runoffo' 468 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' .OR. TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 469 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) srcv(jpr_rnf)%laction = .TRUE. 470 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 471 srcv(jpr_rnf_1d)%laction = .TRUE. 472 srcv(jpr_rnf_1d)%dimensions = 1 ! 1D field passed through coupler 473 END IF 464 474 l_rnfcpl = .TRUE. ! -> no need to read runoffs in sbcrnf 465 475 ln_rnf = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas … … 468 478 ENDIF 469 479 ! 470 srcv(jpr_cal )%clname = 'OCalving' ; IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' ) srcv(jpr_cal)%laction = .TRUE. 471 srcv(jpr_grnm )%clname = 'OGrnmass' ; IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' ) srcv(jpr_grnm)%laction = .TRUE. 472 srcv(jpr_antm )%clname = 'OAntmass' ; IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' ) srcv(jpr_antm)%laction = .TRUE. 480 srcv(jpr_cal )%clname = 'OCalving' 481 IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' ) srcv(jpr_cal)%laction = .TRUE. 482 483 srcv(jpr_grnm )%clname = 'OGrnmass' 484 IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm)%laction = .TRUE. 485 IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm )%dimensions = 0 ! Scalar field 486 487 srcv(jpr_antm )%clname = 'OAntmass' 488 IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_antm%cldes ) == 'coupled0d' ) srcv(jpr_antm)%laction = .TRUE. 489 IF( TRIM( sn_rcv_antm%cldes ) == 'coupled0d' ) srcv(jpr_antm )%dimensions = 0 ! Scalar field 490 473 491 474 492 … … 657 675 ENDIF 658 676 ENDIF 659 660 ! =================================================== !661 ! Allocate all parts of frcv used for received fields !662 ! =================================================== !663 DO jn = 1, jprcv664 IF ( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) )665 END DO666 ! Allocate taum part of frcv which is used even when not received as coupling field667 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) )668 ! Allocate w10m part of frcv which is used even when not received as coupling field669 IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) )670 ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field671 IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) )672 IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) )673 ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.674 IF( k_ice /= 0 ) THEN675 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) )676 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) )677 END IF678 677 679 678 ! ================================ ! … … 685 684 686 685 ! default definitions of nsnd 687 ssnd(:)%laction = .FALSE. ; ssnd(:)%clgrid = 'T' ; ssnd(:)%nsgn = 1. ; ssnd(:)%nct = 1 686 ssnd(:)%laction = .FALSE. ; ssnd(:)%clgrid = 'T' ; ssnd(:)%nsgn = 1. ; ssnd(:)%nct = 1 ; ssnd(:)%dimensions = 2 688 687 689 688 ! ! ------------------------- ! … … 942 941 ENDIF 943 942 ENDIF 943 944 ! Initialise 1D river outflow scheme 945 nn_cpl_river = 1 946 IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_init ! Coupled runoff using 1D array 947 948 ! =================================================== ! 949 ! Allocate all parts of frcv used for received fields ! 950 ! =================================================== ! 951 DO jn = 1, jprcv 952 953 IF ( srcv(jn)%laction ) THEN 954 SELECT CASE( srcv(jn)%dimensions ) 955 ! 956 CASE( 0 ) ! Scalar field 957 ALLOCATE( frcv(jn)%z3(1,1,1) ) 958 959 CASE( 1 ) ! 1D field 960 ALLOCATE( frcv(jn)%z3(nn_cpl_river,1,1) ) 961 962 CASE DEFAULT ! 2D (or pseudo 3D) field. 963 ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) ) 964 965 END SELECT 966 END IF 967 968 END DO 969 ! Allocate taum part of frcv which is used even when not received as coupling field 970 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) ) 971 ! Allocate w10m part of frcv which is used even when not received as coupling field 972 IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) ) 973 ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field 974 IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) ) 975 IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) ) 976 ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE. 977 IF( k_ice /= 0 ) THEN 978 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) ) 979 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 980 END IF 944 981 945 982 ! … … 1073 1110 isec = ( kt - nit000 ) * NINT( rdttra(1) ) ! date of exchanges 1074 1111 DO jn = 1, jprcv ! received fields sent by the atmosphere 1075 IF( srcv(jn)%laction ) CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 1112 IF( srcv(jn)%laction ) THEN 1113 1114 IF ( srcv(jn)%dimensions <= 1 ) THEN 1115 CALL cpl_rcv_1d( jn, isec, frcv(jn)%z3, SIZE(frcv(jn)%z3), nrcvinfo(jn) ) 1116 ELSE 1117 CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 1118 END IF 1119 1120 END IF 1076 1121 END DO 1077 1078 1122 ! ! ========================= ! 1079 1123 IF( srcv(jpr_otx1)%laction ) THEN ! ocean stress components ! … … 1378 1422 1379 1423 IF( srcv(jpr_grnm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN 1380 greenland_icesheet_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 1381 ! take average over ocean points of input array to avoid cumulative error over time 1382 ! The following must be bit reproducible over different PE decompositions 1383 zgreenland_icesheet_mass_in = glob_sum( greenland_icesheet_mass_array(:,:) * tmask(:,:,1) ) 1384 1385 zgreenland_icesheet_mass_in = zgreenland_icesheet_mass_in / zmask_sum 1424 1425 IF( srcv(jpr_grnm)%dimensions == 0 ) THEN 1426 1427 ! This is a zero dimensional, single value field. 1428 zgreenland_icesheet_mass_in = frcv(jpr_grnm)%z3(1,1,1) 1429 1430 ELSE 1431 1432 greenland_icesheet_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 1433 ! take average over ocean points of input array to avoid cumulative error over time 1434 ! The following must be bit reproducible over different PE decompositions 1435 zgreenland_icesheet_mass_in = glob_sum( greenland_icesheet_mass_array(:,:) * tmask(:,:,1) ) 1436 zgreenland_icesheet_mass_in = zgreenland_icesheet_mass_in / zmask_sum 1437 1438 END IF 1439 1386 1440 greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt 1387 1441 … … 1415 1469 ! ! land ice masses : Antarctica 1416 1470 IF( srcv(jpr_antm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN 1417 antarctica_icesheet_mass_array(:,:) = frcv(jpr_antm)%z3(:,:,1) 1418 ! take average over ocean points of input array to avoid cumulative error from rounding errors over time 1419 ! The following must be bit reproducible over different PE decompositions 1420 zantarctica_icesheet_mass_in = glob_sum( antarctica_icesheet_mass_array(:,:) * tmask(:,:,1) ) 1421 1422 zantarctica_icesheet_mass_in = zantarctica_icesheet_mass_in / zmask_sum 1471 1472 IF( srcv(jpr_antm)%dimensions == 0 ) THEN 1473 1474 ! This is a zero dimensional, single value field. 1475 zantarctica_icesheet_mass_in = frcv(jpr_antm)%z3(1,1,1) 1476 1477 ELSE 1478 1479 antarctica_icesheet_mass_array(:,:) = frcv(jpr_antm)%z3(:,:,1) 1480 ! take average over ocean points of input array to avoid cumulative error from rounding errors over time 1481 ! The following must be bit reproducible over different PE decompositions 1482 zantarctica_icesheet_mass_in = glob_sum( antarctica_icesheet_mass_array(:,:) * tmask(:,:,1) ) 1483 zantarctica_icesheet_mass_in = zantarctica_icesheet_mass_in / zmask_sum 1484 1485 END IF 1486 1423 1487 antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt 1424 1488 … … 1821 1885 ! --- runoffs (included in emp later on) --- ! 1822 1886 IF( srcv(jpr_rnf)%laction ) rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 1887 IF( srcv(jpr_rnf_1d)%laction ) CALL cpl_rnf_1d_to_2d(frcv(jpr_rnf_1d)%z3(:,:,:)) 1823 1888 1824 1889 ! --- calving (put in emp_tot and emp_oce) --- ! … … 1858 1923 ! runoffs and calving (put in emp_tot) 1859 1924 IF( srcv(jpr_rnf)%laction ) rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 1925 IF( srcv(jpr_rnf_1d)%laction ) CALL cpl_rnf_1d_to_2d(frcv(jpr_rnf_1d)%z3(:,:,:)) 1860 1926 IF( iom_use('hflx_rnf_cea') ) & 1861 1927 CALL iom_put( 'hflx_rnf_cea' , rnf(:,:) * zcptn(:,:) )
Note: See TracChangeset
for help on using the changeset viewer.