@@ -123,7 +123,7 @@ subroutine init_forcing
123
123
i ! index
124
124
125
125
character (len=* ), parameter :: subname= ' (init_forcing)'
126
-
126
+
127
127
! Initialize ntime and allocate data arrays
128
128
if (precalc_forc) then
129
129
ntime = npt
@@ -1030,7 +1030,7 @@ end subroutine atm_NICE
1030
1030
! =======================================================================
1031
1031
1032
1032
subroutine atm_MOSAiC
1033
-
1033
+
1034
1034
integer (kind= int_kind) :: &
1035
1035
nt, & ! timestep index for Icepack arrays
1036
1036
i, & ! index for forcing data arrays
@@ -1040,41 +1040,41 @@ subroutine atm_MOSAiC
1040
1040
dimid, & ! NetCDF dimension id
1041
1041
status, & ! NetCDF status flag
1042
1042
varid ! NetCDF variable id
1043
-
1043
+
1044
1044
integer (kind= 8 ), allocatable :: &
1045
1045
data_time(:) ! array for time array in forcing data
1046
-
1046
+
1047
1047
integer (kind= 8 ), dimension (ntime) :: &
1048
1048
model_time ! array for Icepack minutely time
1049
1049
1050
1050
real (kind= dbl_kind) :: &
1051
1051
work, & ! variable for moving averaging
1052
1052
model_time0
1053
-
1053
+
1054
1054
real (kind= dbl_kind), allocatable :: &
1055
1055
data (:) ! data array from file
1056
1056
1057
1057
character (char_len) :: &
1058
1058
calendar_type, & ! data calendar type
1059
1059
varname
1060
-
1060
+
1061
1061
character (char_len_long) :: &
1062
1062
filename, &
1063
1063
time_basis ! time basis for data
1064
-
1064
+
1065
1065
integer (kind= int_kind), dimension (ntime, 2 ) :: &
1066
1066
data_sections ! 2D array for indices corresponding
1067
1067
! to which data values should be averaged to
1068
1068
! create the model forcing values
1069
-
1069
+
1070
1070
real (kind= dbl_kind), parameter :: &
1071
1071
Gregorian_year = 365.2425 , & ! days in Gregorian year per cf standard
1072
1072
model_miss_val = - 9999.00 ! missing value for internal use
1073
1073
1074
1074
character (len=* ), parameter :: subname= ' (atm_MOSAiC)'
1075
1075
1076
1076
filename = trim (data_dir)// ' /MOSAiC/' // trim (atm_data_file)
1077
-
1077
+
1078
1078
if (atm_data_format == ' nc' ) then
1079
1079
#ifdef USE_NETCDF
1080
1080
! Open forcing file
@@ -1197,7 +1197,7 @@ subroutine atm_MOSAiC
1197
1197
1198
1198
! Currently no rainfall data, to do
1199
1199
frain_data(:) = c0
1200
-
1200
+
1201
1201
#else
1202
1202
call icedrv_system_abort(string= subname// &
1203
1203
' ERROR: atm_data_format = "nc" requires USE_NETCDF' , &
@@ -1219,37 +1219,37 @@ subroutine MOSAiC_average(data_var_name, model_var_arr, &
1219
1219
1220
1220
character (len=* ), intent (in ) :: &
1221
1221
data_var_name ! Name of the variable in the MDF forcing file
1222
-
1222
+
1223
1223
real (kind= dbl_kind), dimension (ntime), intent (out ) :: &
1224
1224
model_var_arr ! array to place averaged forcing data in
1225
-
1225
+
1226
1226
integer (kind= int_kind), intent (in ) :: &
1227
1227
data_var_len, & ! Size of data array in MDF forcing file
1228
1228
ncid ! NetCDF file id
1229
-
1229
+
1230
1230
integer (kind= int_kind), dimension (ntime, 2 ) :: &
1231
1231
data_sections ! indices for which data values to average
1232
-
1232
+
1233
1233
real (kind= dbl_kind), intent (in ) :: &
1234
1234
model_miss_val ! for when there is no data in a time step
1235
-
1235
+
1236
1236
! Local variables
1237
1237
real (kind= dbl_kind), dimension (data_var_len) :: &
1238
1238
data_var_arr ! array for data from forcing file
1239
-
1239
+
1240
1240
real (kind= dbl_kind) :: &
1241
1241
work, & ! variable for averaging
1242
1242
data_miss_val, & ! value of missing data
1243
1243
count ! counter for data to average
1244
-
1244
+
1245
1245
integer (kind= int_kind) :: &
1246
1246
status, & ! NetCDF status flag
1247
1247
nt, & ! timestep index for Icepack arrays
1248
1248
i, & ! index for forcing data arrays
1249
1249
varid ! NetCDF variable id
1250
-
1250
+
1251
1251
character (len=* ), parameter :: subname= ' (MOSAiC_average)'
1252
-
1252
+
1253
1253
! Allocate get data and missing value from file
1254
1254
status = nf90_inq_varid(ncid, trim (data_var_name), varid)
1255
1255
if (status /= nf90_noerr) call icedrv_system_abort(&
@@ -1263,7 +1263,7 @@ subroutine MOSAiC_average(data_var_name, model_var_arr, &
1263
1263
if (status /= nf90_noerr) call icedrv_system_abort(&
1264
1264
string= subname// ' Couldnt get ' // data_var_name// ' values' , &
1265
1265
file= __FILE__,line= __LINE__)
1266
-
1266
+
1267
1267
! For each model time point average non-missing data values
1268
1268
do nt = 1 , ntime
1269
1269
count = 0
@@ -1287,18 +1287,18 @@ end subroutine MOSAiC_average
1287
1287
! =======================================================================
1288
1288
1289
1289
subroutine MOSAiC_interpolate (model_var_arr , model_miss_val )
1290
-
1290
+
1291
1291
real (kind= dbl_kind), dimension (ntime), intent (inout ) :: &
1292
1292
model_var_arr ! array to place averaged forcing data in
1293
-
1293
+
1294
1294
real (kind= dbl_kind), intent (in ) :: &
1295
1295
model_miss_val ! for when there is no data in a time step
1296
1296
1297
1297
integer (kind= int_kind) :: &
1298
1298
mlast, & ! index of last present data
1299
1299
nt, m, & ! model timestep indices
1300
1300
count ! counter for missing values
1301
-
1301
+
1302
1302
character (len=* ), parameter :: subname= ' (MOSAiC_interpolate)'
1303
1303
1304
1304
! Interpolate, extrapolate for first and last values
@@ -1441,7 +1441,7 @@ end subroutine ocn_ISPOL
1441
1441
! =======================================================================
1442
1442
1443
1443
subroutine ocn_MOSAiC
1444
-
1444
+
1445
1445
integer (kind= int_kind) :: &
1446
1446
nt, & ! timestep index for Icepack arrays
1447
1447
i, & ! index for forcing data arrays
@@ -1451,17 +1451,17 @@ subroutine ocn_MOSAiC
1451
1451
dimid, & ! NetCDF dimension id
1452
1452
status, & ! NetCDF status flag
1453
1453
varid ! NetCDF variable id
1454
-
1454
+
1455
1455
integer (kind= 8 ), allocatable :: &
1456
1456
data_time(:) ! array for time array in forcing data
1457
-
1457
+
1458
1458
integer (kind= 8 ), dimension (ntime) :: &
1459
1459
model_time ! array for Icepack minutely time
1460
1460
1461
1461
real (kind= dbl_kind) :: &
1462
1462
work, & ! variable for moving averaging
1463
1463
model_time0
1464
-
1464
+
1465
1465
real (kind= dbl_kind), allocatable :: &
1466
1466
data (:) ! data array from file
1467
1467
@@ -1470,24 +1470,24 @@ subroutine ocn_MOSAiC
1470
1470
test_1, &
1471
1471
test_2, &
1472
1472
varname
1473
-
1473
+
1474
1474
character (char_len_long) :: &
1475
1475
filename, &
1476
1476
time_basis ! time basis for data
1477
-
1477
+
1478
1478
integer (kind= int_kind), dimension (ntime, 2 ) :: &
1479
1479
data_sections ! 2D array for indices corresponding
1480
1480
! to which data values should be averaged to
1481
1481
! create the model forcing values
1482
-
1482
+
1483
1483
real (kind= dbl_kind), parameter :: &
1484
1484
Gregorian_year = 365.2425 , & ! days in Gregorian year per cf standard
1485
1485
model_miss_val = - 9999.00 ! missing value for internal use
1486
1486
1487
1487
character (len=* ), parameter :: subname= ' (ocn_MOSAiC)'
1488
1488
1489
1489
filename = trim (data_dir)// ' /MOSAiC/' // trim (ocn_data_file)
1490
-
1490
+
1491
1491
if (ocn_data_format == ' nc' ) then
1492
1492
#ifdef USE_NETCDF
1493
1493
! Open forcing file
@@ -1582,7 +1582,7 @@ subroutine ocn_MOSAiC
1582
1582
data_sections, model_miss_val)
1583
1583
call MOSAiC_average(" hfsot" , qdp_data, dimlen, ncid, &
1584
1584
data_sections, model_miss_val)
1585
-
1585
+
1586
1586
! Linearly interpolate missing values
1587
1587
call MOSAiC_interpolate(sss_data, model_miss_val)
1588
1588
call MOSAiC_interpolate(hmix_data, model_miss_val)
@@ -1597,10 +1597,10 @@ subroutine ocn_MOSAiC
1597
1597
call icedrv_system_abort(string= subname// &
1598
1598
' ERROR: only NetCDF input implemented for ocn_MOSAiC' , &
1599
1599
file= __FILE__,line= __LINE__)
1600
- endif
1600
+ endif
1601
1601
1602
1602
end subroutine ocn_MOSAiC
1603
-
1603
+
1604
1604
! =======================================================================
1605
1605
1606
1606
subroutine finish_ocn_forcing (sst_temp )
0 commit comments