Changeset 7325 for branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba
- Timestamp:
- 2021-10-20T17:04:48+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/slowproc.f90
r7265 r7325 935 935 LOGICAL :: found_restart !! found_restart=true if all 3 variables veget_max, veget and 936 936 !! frac_nobio are read from restart file 937 LOGICAL :: call_slowproc_soilt !! This variables will be true if subroutine slowproc_soilt needs to be called 937 938 !_ ================================================================================================================================ 938 939 … … 1075 1076 1076 1077 ! Below we define the soil texture of the grid-cells 1078 1077 1079 ! Add the soil_classif as suffix for the variable name of njsc when it is stored in the restart file. 1078 1080 IF (soil_classif == 'zobler') THEN … … 1084 1086 END IF 1085 1087 1088 ! The variables are read from restart file. If at least one of the related variables are not found, the 1089 ! variable call_slowproc_soilt will be true and the variables will be read and interpolated from file in 1090 ! subroutine slowproc_soilt. 1091 call_slowproc_soilt=.FALSE. 1092 1086 1093 CALL ioconf_setatt_p('UNITS', '-') 1087 1094 CALL ioconf_setatt_p('LONG_NAME','Index of soil type') … … 1089 1096 IF ( ALL( tmp_real(:) .EQ. val_exp) ) THEN 1090 1097 njsc (:) = undef_int 1098 call_slowproc_soilt=.TRUE. 1091 1099 ELSE 1092 1100 njsc = NINT(tmp_real) … … 1094 1102 1095 1103 ! Salma: we define restget for the 7 soil variables following clay_frac 1096 1104 1097 1105 var_name= 'ks' 1098 1106 CALL ioconf_setatt_p('UNITS', 'mm/d') 1099 1107 CALL ioconf_setatt_p('LONG_NAME','Soil saturated water content') 1100 1108 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., ks, "gather", nbp_glo, index_g) 1109 IF ( ALL(ks(:) .EQ. val_exp ) ) THEN 1110 ! ks is not in restart file 1111 call_slowproc_soilt=.TRUE. 1112 END IF 1101 1113 1102 1114 var_name= 'mcs' … … 1104 1116 CALL ioconf_setatt_p('LONG_NAME','') 1105 1117 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., mcs, "gather", nbp_glo, index_g) 1118 IF ( ALL(mcs(:) .EQ. val_exp ) ) THEN 1119 ! mcs is not in restart file 1120 call_slowproc_soilt=.TRUE. 1121 END IF 1106 1122 1107 1123 var_name= 'mcr' … … 1109 1125 CALL ioconf_setatt_p('LONG_NAME','') 1110 1126 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., mcr, "gather", nbp_glo, index_g) 1127 IF ( ALL(mcr(:) .EQ. val_exp ) ) THEN 1128 ! mcr is not in restart file 1129 call_slowproc_soilt=.TRUE. 1130 END IF 1111 1131 1112 1132 var_name= 'mcfc' … … 1114 1134 CALL ioconf_setatt_p('LONG_NAME','') 1115 1135 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., mcfc, "gather", nbp_glo, index_g) 1136 IF ( ALL(mcfc(:) .EQ. val_exp ) ) THEN 1137 ! mcfc is not in restart file 1138 call_slowproc_soilt=.TRUE. 1139 END IF 1116 1140 1117 1141 var_name= 'mcw' … … 1119 1143 CALL ioconf_setatt_p('LONG_NAME','') 1120 1144 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., mcw, "gather", nbp_glo, index_g) 1145 IF ( ALL(mcw(:) .EQ. val_exp ) ) THEN 1146 ! mcw is not in restart file 1147 call_slowproc_soilt=.TRUE. 1148 END IF 1121 1149 1122 1150 var_name= 'nvan' … … 1124 1152 CALL ioconf_setatt_p('LONG_NAME','') 1125 1153 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., nvan, "gather", nbp_glo, index_g) 1154 IF ( ALL(nvan(:) .EQ. val_exp ) ) THEN 1155 ! nvan is not in restart file 1156 call_slowproc_soilt=.TRUE. 1157 END IF 1126 1158 1127 1159 var_name= 'avan' … … 1129 1161 CALL ioconf_setatt_p('LONG_NAME','') 1130 1162 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., avan, "gather", nbp_glo, index_g) 1163 IF ( ALL(avan(:) .EQ. val_exp ) ) THEN 1164 ! avan is not in restart file 1165 call_slowproc_soilt=.TRUE. 1166 END IF 1131 1167 1132 1168 !end salma … … 1136 1172 CALL ioconf_setatt_p('LONG_NAME','Fraction of clay in each mesh') 1137 1173 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., clayfraction, "gather", nbp_glo, index_g) 1174 IF ( ALL(clayfraction(:) .EQ. val_exp ) ) THEN 1175 ! clayfraction is not in restart file 1176 call_slowproc_soilt=.TRUE. 1177 END IF 1138 1178 1139 1179 var_name= 'sand_frac' … … 1141 1181 CALL ioconf_setatt_p('LONG_NAME','Fraction of sand in each mesh') 1142 1182 CALL restget_p (rest_id, var_name, nbp_glo, 1, 1, kjit, .TRUE., sandfraction, "gather", nbp_glo, index_g) 1183 IF ( ALL(sandfraction(:) .EQ. val_exp ) ) THEN 1184 ! sandfraction is not in restart file 1185 call_slowproc_soilt=.TRUE. 1186 END IF 1143 1187 1144 1188 ! Calculate siltfraction not needed to be in restart file … … 1318 1362 ELSE ! impveg=T and impsoil=F 1319 1363 ! Case impsoilt=false and impveg=true 1320 IF ( MINVAL(clayfraction) .EQ. MAXVAL(clayfraction) .AND. MAXVAL(clayfraction) .EQ. val_exp .OR. & 1321 MINVAL(sandfraction) .EQ. MAXVAL(sandfraction) .AND. MAXVAL(sandfraction) .EQ. val_exp .OR. & 1322 MINVAL(njsc) .EQ. MAXVAL(njsc) .AND. MAXVAL(njsc) .EQ. undef_int ) THEN 1323 1364 IF (call_slowproc_soilt) THEN 1365 ! At least one of the output variables from slowproc_soilt were not found in the restart file 1324 1366 CALL slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, lalo, neighbours, resolution, contfrac, soilclass, & 1325 1367 clayfraction, sandfraction, siltfraction) … … 1328 1370 njsc(ji) = MAXLOC(soilclass(ji,:),1) 1329 1371 ENDDO 1372 call_slowproc_soilt=.FALSE. 1330 1373 ENDIF 1331 1374 ENDIF … … 1453 1496 ENDIF 1454 1497 1455 ! Initialize clayfraction and njsc if not found in restart file and not already initialized using impveg 1456 IF ( MINVAL(clayfraction) .EQ. MAXVAL(clayfraction) .AND. MAXVAL(clayfraction) .EQ. val_exp .OR. & 1457 MINVAL(sandfraction) .EQ. MAXVAL(sandfraction) .AND. MAXVAL(sandfraction) .EQ. val_exp .OR. & 1458 MINVAL(njsc) .EQ. MAXVAL(njsc) .AND. MAXVAL(njsc) .EQ. undef_int ) THEN 1459 1460 IF (printlev_loc>=4) WRITE (numout,*) 'clayfraction or njcs were not in restart file, call slowproc_soilt' 1498 ! Initialize clayfraction, sandfraction, njsc, ks, nvan, avan, mcr, mcs, mcfc and mcw if one of them 1499 ! were not found in restart file and not already initialized using impveg 1500 IF (call_slowproc_soilt) THEN 1501 IF (printlev_loc>=4) WRITE (numout,*) 'clayfraction or njcs or one of the 7 new variables were not in restart file, call slowproc_soilt' 1461 1502 CALL slowproc_soilt(njsc, ks, nvan, avan, mcr, mcs, mcfc, mcw, kjpindex, lalo, neighbours, resolution, contfrac, soilclass, & 1462 1503 clayfraction, sandfraction, siltfraction) … … 1466 1507 njsc(ji) = MAXLOC(soilclass(ji,:),1) 1467 1508 ENDDO 1509 call_slowproc_soilt=.FALSE. 1468 1510 ENDIF 1469 1511
Note: See TracChangeset
for help on using the changeset viewer.