@@ -341,6 +341,8 @@ module scm_type_defs
341
341
real (kind= dp) :: input_sfalb_ice ! <
342
342
real (kind= dp) :: input_emis_ice ! <
343
343
real (kind= dp) :: input_lai ! < leaf area index for RUC LSM
344
+ real (kind= dp) :: input_snodi
345
+ real (kind= dp) :: input_weasdi
344
346
345
347
real (kind= dp), allocatable :: input_tslb(:) ! < soil temperature for RUC LSM (K)
346
348
real (kind= dp), allocatable :: input_smois(:) ! < volume fraction of soil moisture for RUC LSM (frac)
@@ -850,6 +852,8 @@ subroutine scm_input_create(scm_input, ntimes, nlev, nsoil, nsnow, nice, nvegcat
850
852
scm_input% input_sfalb_lnd_bck = real_zero
851
853
scm_input% input_emis_ice = real_zero
852
854
scm_input% input_lai = real_zero ! < leaf area index for RUC LSM
855
+ scm_input% input_snodi = real_zero
856
+ scm_input% input_weasdi = real_zero
853
857
854
858
allocate (scm_input% input_tslb(nsoil), scm_input% input_smois(nsoil), scm_input% input_sh2o(nsoil), &
855
859
scm_input% input_smfr(nsoil), scm_input% input_flfr(nsoil))
@@ -1076,8 +1080,8 @@ subroutine physics_set(physics, scm_input, scm_state)
1076
1080
! since landfrac and lakefrac are read in with the orographic data (here and in FV3GFS_io), we need to set their values
1077
1081
! to -999.9 when only LSM ICs are available in order for some of the logic below to work as intended.
1078
1082
if (scm_state% lsm_ics) then
1079
- physics% Sfcprop% landfrac(i) = - 999.9
1080
- physics% Sfcprop% lakefrac(i) = - 999.9
1083
+ physics% Sfcprop% landfrac(i) = missing_value
1084
+ physics% Sfcprop% lakefrac(i) = missing_value
1081
1085
end if
1082
1086
!
1083
1087
! Orographical data (2D)
@@ -1222,7 +1226,7 @@ subroutine physics_set(physics, scm_input, scm_state)
1222
1226
! Derive physics quantities using surface model ICs.
1223
1227
!
1224
1228
if (scm_state% model_ics .or. scm_state% lsm_ics) then
1225
- if (physics% Sfcprop% stype(i) == 14 .or. physics% Sfcprop% stype(i)+ 0.5 <= 0 ) then
1229
+ if (physics% Sfcprop% stype(i) == 14 .or. physics% Sfcprop% stype(i) <= 0 ) then
1226
1230
physics% Sfcprop% landfrac(i) = real_zero
1227
1231
physics% Sfcprop% stype(i) = 0
1228
1232
if (physics% Sfcprop% lakefrac(i) > real_zero) then
@@ -1231,7 +1235,7 @@ subroutine physics_set(physics, scm_input, scm_state)
1231
1235
endif
1232
1236
1233
1237
if (physics% Model% frac_grid) then
1234
- if (physics% Sfcprop% landfrac(i) > - 999.0_dp ) then
1238
+ if (.not. is_missing_value( physics% Sfcprop% landfrac(i)) ) then
1235
1239
physics% Sfcprop% slmsk(i) = ceiling (physics% Sfcprop% landfrac(i)- 1.0e-6 )
1236
1240
if (physics% Sfcprop% slmsk(i) == 1 .and. physics% Sfcprop% stype(i) == 14 ) &
1237
1241
physics% Sfcprop% slmsk(i) = 0
@@ -1275,7 +1279,7 @@ subroutine physics_set(physics, scm_input, scm_state)
1275
1279
endif
1276
1280
endif
1277
1281
else ! not a fractional grid
1278
- if (physics% Sfcprop% landfrac(i) > - 999.0_dp ) then
1282
+ if (.not. is_missing_value( physics% Sfcprop% landfrac(i)) ) then
1279
1283
if (physics% Sfcprop% lakefrac(i) > real_zero) then
1280
1284
physics% Sfcprop% oceanfrac(i) = real_zero
1281
1285
physics% Sfcprop% landfrac(i) = real_zero
@@ -1319,7 +1323,6 @@ subroutine physics_set(physics, scm_input, scm_state)
1319
1323
endif
1320
1324
endif
1321
1325
end if
1322
-
1323
1326
!
1324
1327
! NSSTM variables
1325
1328
!
@@ -1394,7 +1397,7 @@ subroutine physics_set(physics, scm_input, scm_state)
1394
1397
! Compute surface fields that may/maynot present in model IC files.
1395
1398
!
1396
1399
if (scm_state% model_ics .or. scm_state% lsm_ics) then
1397
- if (scm_input% input_snodl < = real_zero) then
1400
+ if (is_missing_value( scm_input% input_snodl) .or. scm_input % input_snodl = = real_zero) then
1398
1401
if (physics% Sfcprop% landfrac(i) > real_zero) then
1399
1402
tem = real_one / physics% Sfcprop% landfrac(i)
1400
1403
physics% Sfcprop% snodl(i) = physics% Sfcprop% snowd(i) * tem
@@ -1403,34 +1406,60 @@ subroutine physics_set(physics, scm_input, scm_state)
1403
1406
endif
1404
1407
end if
1405
1408
1406
- if (scm_input% input_weasdl < = real_zero) then
1409
+ if (is_missing_value( scm_input% input_weasdl) .or. scm_input % input_weasdl = = real_zero) then
1407
1410
if (physics% Sfcprop% landfrac(i) > real_zero) then
1408
- tem = real_one / physics% Sfcprop% landfrac(i)
1411
+ tem = real_one / ( physics% Sfcprop% fice(i) * (real_one - physics % Sfcprop % landfrac(i)) + physics % Sfcprop % landfrac(i) )
1409
1412
physics% Sfcprop% weasdl(i) = physics% Sfcprop% weasd(i) * tem
1410
1413
else
1411
1414
physics% Sfcprop% weasdl(i) = real_zero
1412
1415
endif
1413
1416
end if
1414
1417
end if
1415
1418
1416
- if (scm_input% input_tsfcl < = real_zero) then
1419
+ if (is_missing_value( scm_input% input_tsfcl) .or. scm_input % input_tsfcl = = real_zero) then
1417
1420
physics% Sfcprop% tsfcl(i) = physics% Sfcprop% tsfco(i) !- -- compute tsfcl from existing variables
1418
1421
end if
1419
1422
1420
- if (scm_input% input_zorlw < = real_zero) then
1423
+ if (is_missing_value( scm_input% input_zorlw) .or. scm_input % input_zorlw = = real_zero) then
1421
1424
physics% Sfcprop% zorlw(i) = physics% Sfcprop% zorl(i) !- -- compute zorlw from existing variables
1422
1425
end if
1423
1426
1424
- if (scm_input% input_zorll < = real_zero) then
1427
+ if (is_missing_value( scm_input% input_zorll) .or. scm_input % input_zorll = = real_zero) then
1425
1428
physics% Sfcprop% zorll(i) = physics% Sfcprop% zorl(i) !- -- compute zorll from existing variables
1426
1429
end if
1427
1430
1428
- if (scm_input% input_zorli < = real_zero) then
1431
+ if (is_missing_value( scm_input% input_zorli) .or. scm_input % input_zorli = = real_zero) then
1429
1432
physics% Sfcprop% zorli(i) = physics% Sfcprop% zorl(i) !- -- compute zorli from existing variables
1430
1433
end if
1431
1434
1435
+ if (is_missing_value(scm_input% input_emis_ice) .or. scm_input% input_emis_ice == real_zero) then
1436
+ physics% Sfcprop% emis_ice(i) = 0.96
1437
+ end if
1438
+
1439
+ if (((is_missing_value(scm_input% input_sncovr_ice) .or. scm_input% input_sncovr_ice == real_zero)) .and. physics% Model% lsm /= physics% Model% lsm_ruc) then
1440
+ physics% Sfcprop% sncovr_ice(i) = real_zero
1441
+ end if
1442
+
1443
+ if (is_missing_value(scm_input% input_snodi) .or. scm_input% input_snodi == real_zero) then
1444
+ if (physics% Sfcprop% fice(i) > real_zero) then
1445
+ tem = real_one / (physics% Sfcprop% fice(i)* (real_one- physics% Sfcprop% landfrac(i))+ physics% Sfcprop% landfrac(i))
1446
+ physics% Sfcprop% snodi(i) = min (physics% Sfcprop% snowd(i) * tem, 3.0 )
1447
+ else
1448
+ physics% Sfcprop% snodi(i) = real_zero
1449
+ endif
1450
+ end if
1451
+
1452
+ if (is_missing_value(scm_input% input_weasdi) .or. scm_input% input_weasdi == real_zero) then
1453
+ if (physics% Sfcprop% fice(i) > real_zero) then
1454
+ tem = real_one / (physics% Sfcprop% fice(i)* (real_one- physics% Sfcprop% landfrac(i))+ physics% Sfcprop% landfrac(i))
1455
+ physics% Sfcprop% weasdi(i) = physics% Sfcprop% weasd(i)* tem
1456
+ else
1457
+ physics% Sfcprop% weasdi(i) = real_zero
1458
+ endif
1459
+ end if
1460
+
1432
1461
if (physics% Model% use_cice_alb) then
1433
- if (scm_input% input_albdirvis_ice < = real_zero) then
1462
+ if (is_missing_value( scm_input% input_albdirvis_ice) .or. scm_input % input_albdirvis_ice = = real_zero) then
1434
1463
if (physics% Sfcprop% oceanfrac(i) > real_zero .and. &
1435
1464
physics% Sfcprop% fice(i) >= physics% Model% min_seaice) then
1436
1465
physics% Sfcprop% albdirvis_ice(i) = 0.6_dp
@@ -1441,34 +1470,28 @@ subroutine physics_set(physics, scm_input, scm_state)
1441
1470
endif
1442
1471
endif
1443
1472
1444
- if (scm_input% input_zorlwav < = real_zero) then
1473
+ if (is_missing_value( scm_input% input_zorlwav) .or. scm_input % input_zorlwav = = real_zero) then
1445
1474
physics% Sfcprop% zorlwav(i) = physics% Sfcprop% zorlw(i) !- -- compute zorlwav from existing variables
1446
1475
end if
1447
-
1448
- if (physics% Model% frac_grid .and. (scm_state% model_ics .or. scm_state% lsm_ics) ) then ! 3-way composite
1449
- if ( physics% Model% phour < 1.e-7 ) physics% Sfcprop% tsfco(i) = max (con_tice, physics% Sfcprop% tsfco(i))
1450
- tem1 = real_one - physics% Sfcprop% landfrac(i)
1451
- tem = tem1 * physics% Sfcprop% fice(i) ! tem = ice fraction wrt whole cell
1452
- physics% Sfcprop% zorl(i) = physics% Sfcprop% zorll(i) * physics% Sfcprop% landfrac(i) &
1453
- + physics% Sfcprop% zorli(i) * tem &
1454
- + physics% Sfcprop% zorlw(i) * (tem1- tem)
1455
-
1456
- physics% Sfcprop% tsfc(i) = physics% Sfcprop% tsfcl(i) * physics% Sfcprop% landfrac(i) &
1457
- + physics% Sfcprop% tisfc(i) * tem &
1458
- + physics% Sfcprop% tsfco(i) * (tem1- tem)
1459
- else
1460
- if (physics% Sfcprop% slmsk(i) == 1 ) then
1461
- physics% Sfcprop% zorl(i) = physics% Sfcprop% zorll(i)
1476
+
1477
+ if (is_missing_value(scm_input% input_tsfc) .or. scm_input% input_tsfc == real_zero) then
1478
+ if (physics% Model% frac_grid) then
1479
+ physics% Sfcprop% tsfco(i) = max (con_tice, physics% Sfcprop% tsfco(i))
1480
+ tem1 = real_one - physics% Sfcprop% landfrac(i)
1481
+ tem = tem1 * physics% Sfcprop% fice(i) ! tem = ice fraction wrt whole cell
1482
+ physics% Sfcprop% tsfc(i) = physics% Sfcprop% tsfcl(i) * physics% Sfcprop% landfrac(i) &
1483
+ + physics% Sfcprop% tisfc(i) * tem &
1484
+ + physics% Sfcprop% tsfco(i) * (tem1- tem)
1485
+ else
1486
+ if (physics% Sfcprop% slmsk(i) == 1 ) then
1462
1487
physics% Sfcprop% tsfc(i) = physics% Sfcprop% tsfcl(i)
1463
- else
1488
+ else
1464
1489
tem = real_one - physics% Sfcprop% fice(i)
1465
- physics% Sfcprop% zorl(i) = physics% Sfcprop% zorli(i) * physics% Sfcprop% fice(i) &
1466
- + physics% Sfcprop% zorlw(i) * tem
1467
-
1468
1490
physics% Sfcprop% tsfc(i) = physics% Sfcprop% tisfc(i) * physics% Sfcprop% fice(i) &
1469
- + physics% Sfcprop% tsfco(i) * tem
1470
- endif
1471
- endif ! if (Model%frac_grid)
1491
+ + physics% Sfcprop% tsfco(i) * tem
1492
+ endif
1493
+ end if
1494
+ end if
1472
1495
1473
1496
if (scm_state% model_ics .and. check_missing(scm_input% input_tiice)) then
1474
1497
physics% Sfcprop% tiice(i,1 ) = physics% Sfcprop% stc(i,1 ) !- -- initialize internal ice temp from soil temp at layer 1
0 commit comments