Changeset 12580 for NEMO/branches/UKMO/NEMO_4.0.1_icesheet_and_river_coupling/src/OCE/SBC/sbccpl.F90
- Timestamp:
- 2020-03-20T19:38:24+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.1_icesheet_and_river_coupling/src/OCE/SBC/sbccpl.F90
r12577 r12580 36 36 USE eosbn2 ! 37 37 USE sbcrnf , ONLY : l_rnfcpl 38 USE cpl_rnf_1d, ONLY: nn_cpl_river, cpl_rnf_1d_init, cpl_rnf_1d_to_2d ! Variables used in 1D river outflow 38 39 USE sbcisf , ONLY : l_isfcpl 39 40 #if defined key_cice … … 118 119 INTEGER, PARAMETER :: jpr_grnm = 58 ! Greenland ice mass 119 120 INTEGER, PARAMETER :: jpr_antm = 59 ! Antarctic ice mass 120 121 INTEGER, PARAMETER :: jprcv = 59 ! total number of fields received 121 INTEGER, PARAMETER :: jpr_rnf_1d = 60 ! 1D river runoff 122 123 INTEGER, PARAMETER :: jprcv = 60 ! total number of fields received 122 124 123 125 INTEGER, PARAMETER :: jps_fice = 1 ! ice fraction sent to the atmosphere … … 361 363 362 364 ! default definitions of srcv 363 srcv(:)%laction = .FALSE. ; srcv(:)%clgrid = 'T' ; srcv(:)%nsgn = 1. ; srcv(:)%nct = 1 365 srcv(:)%laction = .FALSE. 366 srcv(:)%clgrid = 'T' 367 srcv(:)%nsgn = 1. 368 srcv(:)%nct = 1 369 srcv(:)%dimensions = 2 364 370 365 371 ! ! ------------------------- ! … … 478 484 ! ! ------------------------- ! 479 485 srcv(jpr_rnf )%clname = 'O_Runoff' 480 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN 481 srcv(jpr_rnf)%laction = .TRUE. 486 srcv(jpr_rnf_1d )%clname = 'ORunff1D' 487 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' .OR. TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 488 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) srcv(jpr_rnf)%laction = .TRUE. 489 IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) THEN 490 srcv(jpr_rnf_1d)%laction = .TRUE. 491 srcv(jpr_rnf_1d)%dimensions = 1 ! 1D field passed through coupler 492 END IF 482 493 l_rnfcpl = .TRUE. ! -> no need to read runoffs in sbcrnf 483 494 ln_rnf = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas … … 486 497 ENDIF 487 498 ! 488 srcv(jpr_cal)%clname = 'OCalving' ; IF( TRIM( sn_rcv_cal%cldes) == 'coupled' ) srcv(jpr_cal)%laction = .TRUE. 489 srcv(jpr_grnm )%clname = 'OGrnmass' ; IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' ) srcv(jpr_grnm)%laction = .TRUE. 490 srcv(jpr_antm )%clname = 'OAntmass' ; IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' ) srcv(jpr_antm)%laction = .TRUE. 499 srcv(jpr_cal )%clname = 'OCalving' 500 IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' ) srcv(jpr_cal)%laction = .TRUE. 501 502 srcv(jpr_grnm )%clname = 'OGrnmass' 503 IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm)%laction = .TRUE. 504 IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm )%dimensions = 0 ! Scalar field 505 506 srcv(jpr_antm )%clname = 'OAntmass' 507 IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_antm%cldes ) == 'coupled0d' ) srcv(jpr_antm)%laction = .TRUE. 508 IF( TRIM( sn_rcv_antm%cldes ) == 'coupled0d' ) srcv(jpr_antm )%dimensions = 0 ! Scalar field 491 509 srcv(jpr_isf)%clname = 'OIcshelf' ; IF( TRIM( sn_rcv_isf%cldes) == 'coupled' ) srcv(jpr_isf)%laction = .TRUE. 492 510 srcv(jpr_icb)%clname = 'OIceberg' ; IF( TRIM( sn_rcv_icb%cldes) == 'coupled' ) srcv(jpr_icb)%laction = .TRUE. … … 733 751 ENDIF 734 752 ENDIF 735 736 ! =================================================== !737 ! Allocate all parts of frcv used for received fields !738 ! =================================================== !739 DO jn = 1, jprcv740 IF ( srcv(jn)%laction ) ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) )741 END DO742 ! Allocate taum part of frcv which is used even when not received as coupling field743 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) )744 ! Allocate w10m part of frcv which is used even when not received as coupling field745 IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) )746 ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field747 IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) )748 IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) )749 ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.750 IF( k_ice /= 0 ) THEN751 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) )752 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) )753 END IF754 753 755 754 ! ================================ ! … … 761 760 762 761 ! default definitions of nsnd 763 ssnd(:)%laction = .FALSE. ; ssnd(:)%clgrid = 'T' ; ssnd(:)%nsgn = 1. ; ssnd(:)%nct = 1 762 ssnd(:)%laction = .FALSE. 763 ssnd(:)%clgrid = 'T' 764 ssnd(:)%nsgn = 1. 765 ssnd(:)%nct = 1 766 ssnd(:)%dimensions = 2 764 767 765 768 ! ! ------------------------- ! … … 1040 1043 ENDIF 1041 1044 ENDIF 1045 1046 ! Initialise 1D river outflow scheme 1047 nn_cpl_river = 1 1048 IF ( TRIM( sn_rcv_rnf%cldes ) == 'coupled1d' ) CALL cpl_rnf_1d_init ! Coupled runoff using 1D array 1049 1050 ! =================================================== ! 1051 ! Allocate all parts of frcv used for received fields ! 1052 ! =================================================== ! 1053 DO jn = 1, jprcv 1054 1055 IF ( srcv(jn)%laction ) THEN 1056 SELECT CASE( srcv(jn)%dimensions ) 1057 ! 1058 CASE( 0 ) ! Scalar field 1059 ALLOCATE( frcv(jn)%z3(1,1,1) ) 1060 1061 CASE( 1 ) ! 1D field 1062 ALLOCATE( frcv(jn)%z3(nn_cpl_river,1,1) ) 1063 1064 CASE DEFAULT ! 2D (or pseudo 3D) field. 1065 ALLOCATE( frcv(jn)%z3(jpi,jpj,srcv(jn)%nct) ) 1066 1067 END SELECT 1068 END IF 1069 1070 END DO 1071 ! Allocate taum part of frcv which is used even when not received as coupling field 1072 IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jpr_taum)%nct) ) 1073 ! Allocate w10m part of frcv which is used even when not received as coupling field 1074 IF ( .NOT. srcv(jpr_w10m)%laction ) ALLOCATE( frcv(jpr_w10m)%z3(jpi,jpj,srcv(jpr_w10m)%nct) ) 1075 ! Allocate jpr_otx1 part of frcv which is used even when not received as coupling field 1076 IF ( .NOT. srcv(jpr_otx1)%laction ) ALLOCATE( frcv(jpr_otx1)%z3(jpi,jpj,srcv(jpr_otx1)%nct) ) 1077 IF ( .NOT. srcv(jpr_oty1)%laction ) ALLOCATE( frcv(jpr_oty1)%z3(jpi,jpj,srcv(jpr_oty1)%nct) ) 1078 ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE. 1079 IF( k_ice /= 0 ) THEN 1080 IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jpr_itx1)%nct) ) 1081 IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 1082 END IF 1042 1083 1043 1084 ! … … 1162 1203 isec = ( kt - nit000 ) * NINT( rdt ) ! date of exchanges 1163 1204 DO jn = 1, jprcv ! received fields sent by the atmosphere 1164 IF( srcv(jn)%laction ) CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 1205 IF( srcv(jn)%laction ) THEN 1206 1207 IF ( srcv(jn)%dimensions <= 1 ) THEN 1208 CALL cpl_rcv_1d( jn, isec, frcv(jn)%z3, SIZE(frcv(jn)%z3), nrcvinfo(jn) ) 1209 ELSE 1210 CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 1211 END IF 1212 1213 END IF 1165 1214 END DO 1166 1215 … … 1818 1867 1819 1868 ! --- Continental fluxes --- ! 1820 IF( srcv(jpr_rnf)%laction ) THEN ! runoffs (included in emp later on)1869 IF( srcv(jpr_rnf)%laction ) THEN ! 2D runoffs (included in emp later on) 1821 1870 rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 1871 ENDIF 1872 IF( srcv(jpr_rnf_1d)%laction ) THEN ! 1D runoff 1873 CALL cpl_rnf_1d_to_2d(frcv(jpr_rnf_1d)%z3(:,:,:)) 1822 1874 ENDIF 1823 1875 IF( srcv(jpr_cal)%laction ) THEN ! calving (put in emp_tot and emp_oce) … … 1858 1910 zsnw(:,:) = picefr(:,:) 1859 1911 ! --- Continental fluxes --- ! 1860 IF( srcv(jpr_rnf)%laction ) THEN ! runoffs (included in emp later on)1912 IF( srcv(jpr_rnf)%laction ) THEN ! 2D runoffs (included in emp later on) 1861 1913 rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 1914 ENDIF 1915 IF( srcv(jpr_rnf_1d)%laction ) THEN ! 1D runoff 1916 CALL cpl_rnf_1d_to_2d(frcv(jpr_rnf_1d)%z3(:,:,:)) 1862 1917 ENDIF 1863 1918 IF( srcv(jpr_cal)%laction ) THEN ! calving (put in emp_tot)
Note: See TracChangeset
for help on using the changeset viewer.