1140
1141
1142
1143
1144
1145
1146
1147
1149#ifdef SUBOBJECT_DEALLOCATION
1151#endif
1152
1153
1154
1155 integer, intent(in) :: ng
1156
1157
1158
1159 character (len=*), parameter :: MyFile = &
1160 & __FILE__//", deallocate_forces"
1161
1162#ifdef SUBOBJECT_DEALLOCATION
1163
1164
1165
1166
1167
1168
1169
1170
1171 IF (.not.
destroy(ng, forces(ng)%sustr, myfile, &
1172 & __line__, 'FORCES(ng)%sustr')) RETURN
1173
1174 IF (.not.
destroy(ng, forces(ng)%svstr, myfile, &
1175 & __line__, 'FORCES(ng)%svstr')) RETURN
1176
1177# if !defined ANA_SMFLUX && !defined BULK_FLUXES || \
1178 defined forward_fluxes
1179 IF (.not.
destroy(ng, forces(ng)%sustrG, myfile, &
1180 & __line__, 'FORCES(ng)%sustrG')) RETURN
1181
1182 IF (.not.
destroy(ng, forces(ng)%svstrG, myfile, &
1183 & __line__, 'FORCES(ng)%svstrG')) RETURN
1184# endif
1185
1186# ifdef ADJUST_WSTRESS
1187 IF (.not.
destroy(ng, forces(ng)%ustr, myfile, &
1188 & __line__, 'FORCES(ng)%ustr')) RETURN
1189
1190 IF (.not.
destroy(ng, forces(ng)%vstr, myfile, &
1191 & __line__, 'FORCES(ng)%vstr')) RETURN
1192# endif
1193
1194 IF (.not.
destroy(ng, forces(ng)%bustr, myfile, &
1195 & __line__, 'FORCES(ng)%bustr')) RETURN
1196
1197 IF (.not.
destroy(ng, forces(ng)%bvstr, myfile, &
1198 & __line__, 'FORCES(ng)%bvstr')) RETURN
1199
1200# if defined BULK_FLUXES || defined ECOSIM || defined ATM_PRESS || \
1201 defined spectral_light
1202 IF (.not.
destroy(ng, forces(ng)%Pair, myfile, &
1203 & __line__, 'FORCES(ng)%Pair')) RETURN
1204# ifndef ANA_PAIR
1205 IF (.not.
destroy(ng, forces(ng)%PairG, myfile, &
1206 & __line__, 'FORCES(ng)%PairG')) RETURN
1207# endif
1208# endif
1209
1210# ifdef WAVES_DIR
1211 IF (.not.
destroy(ng, forces(ng)%Dwave, myfile, &
1212 & __line__, 'FORCES(ng)%Dwave')) RETURN
1213# ifndef ANA_WWAVE
1214 IF (.not.
destroy(ng, forces(ng)%DwaveG, myfile, &
1215 & __line__, 'FORCES(ng)%DwaveG')) RETURN
1216# endif
1217# endif
1218
1219# ifdef WAVES_DIRP
1220 IF (.not.
destroy(ng, forces(ng)%Dwavep, myfile, &
1221 & __line__, 'FORCES(ng)%Dwavep')) RETURN
1222# ifndef ANA_WWAVE
1223 IF (.not.
destroy(ng, forces(ng)%DwavepG, myfile, &
1224 & __line__, 'FORCES(ng)%DwavepG')) RETURN
1225# endif
1226# endif
1227
1228# ifdef WAVES_HEIGHT
1229 IF (.not.
destroy(ng, forces(ng)%Hwave, myfile, &
1230 & __line__, 'FORCES(ng)%Hwave')) RETURN
1231# ifndef ANA_WWAVE
1232 IF (.not.
destroy(ng, forces(ng)%HwaveG, myfile, &
1233 & __line__, 'FORCES(ng)%HwaveG')) RETURN
1234# endif
1235# endif
1236
1237# ifdef WAVES_LENGTH
1238 IF (.not.
destroy(ng, forces(ng)%Lwave, myfile, &
1239 & __line__, 'FORCES(ng)%Lwave')) RETURN
1240# ifndef ANA_WWAVE
1241 IF (.not.
destroy(ng, forces(ng)%LwaveG, myfile, &
1242 & __line__, 'FORCES(ng)%LwaveG')) RETURN
1243# endif
1244# endif
1245
1246# ifdef WAVES_LENGTHP
1247 IF (.not.
destroy(ng, forces(ng)%Lwavep, myfile, &
1248 & __line__, 'FORCES(ng)%Lwavep')) RETURN
1249# ifndef ANA_WWAVE
1250 IF (.not.
destroy(ng, forces(ng)%LwavepG, myfile, &
1251 & __line__, 'FORCES(ng)%LwavepG')) RETURN
1252# endif
1253# endif
1254
1255# ifdef WAVES_TOP_PERIOD
1256 IF (.not.
destroy(ng, forces(ng)%Pwave_top, myfile, &
1257 & __line__, 'FORCES(ng)%Pwave_top')) RETURN
1258# ifndef ANA_WWAVE
1259 IF (.not.
destroy(ng, forces(ng)%Pwave_topG, myfile, &
1260 & __line__, 'FORCES(ng)%Pwave_topG')) RETURN
1261# endif
1262# endif
1263
1264# ifdef WAVES_BOT_PERIOD
1265 IF (.not.
destroy(ng, forces(ng)%Pwave_bot, myfile, &
1266 & __line__, 'FORCES(ng)%Pwave_bot')) RETURN
1267# ifndef ANA_WWAVE
1268 IF (.not.
destroy(ng, forces(ng)%Pwave_botG, myfile, &
1269 & __line__, 'FORCES(ng)%Pwave_botG')) RETURN
1270# endif
1271# endif
1272
1273# if defined BBL_MODEL || defined SED_BEDLOAD_VANDERA || \
1274 defined wav_coupling
1275 IF (.not.
destroy(ng, forces(ng)%Uwave_rms, myfile, &
1276 & __line__, 'FORCES(ng)%Uwave_rms')) RETURN
1277# ifndef ANA_WWAVE
1278 IF (.not.
destroy(ng, forces(ng)%Uwave_rmsG, myfile, &
1279 & __line__, 'FORCES(ng)%Uwave_rmsG')) RETURN
1280# endif
1281# endif
1282
1283# if defined TKE_WAVEDISS || defined WAV_COUPLING || \
1284 defined wdiss_thorguza || defined wdiss_churthor || \
1285 defined waves_diss || defined wdiss_inwave
1286 IF (.not.
destroy(ng, forces(ng)%Dissip_break, myfile, &
1287 & __line__, 'FORCES(ng)%Dissip_break')) RETURN
1288 IF (.not.
destroy(ng, forces(ng)%Dissip_wcap, myfile, &
1289 & __line__, 'FORCES(ng)%Dissip_wcap')) RETURN
1290# ifndef ANA_WWAVE
1291 IF (.not.
destroy(ng, forces(ng)%Dissip_breakG, myfile, &
1292 & __line__, 'FORCES(ng)%Dissip_breakG')) RETURN
1293 IF (.not.
destroy(ng, forces(ng)%Dissip_wcapG, myfile, &
1294 & __line__, 'FORCES(ng)%Dissip_wcapG')) RETURN
1295# endif
1296# endif
1297# if defined WAV_COUPLING || (defined WEC_VF && defined BOTTOM_STREAMING)
1298 IF (.not.
destroy(ng, forces(ng)%Dissip_fric, myfile, &
1299 & __line__, 'FORCES(ng)%Dissip_fric')) RETURN
1300# ifndef ANA_WWAVE
1301 IF (.not.
destroy(ng, forces(ng)%Dissip_fricG, myfile, &
1302 & __line__, 'FORCES(ng)%Dissip_fricG')) RETURN
1303# endif
1304# endif
1305
1306# if defined WEC_ROLLER
1307 IF (.not.
destroy(ng, forces(ng)%Dissip_roller, myfile, &
1308 & __line__, 'FORCES(ng)%Dissip_roller')) RETURN
1309 IF (.not.
destroy(ng, forces(ng)%rollA, myfile, &
1310 & __line__, 'FORCES(ng)%rollA')) RETURN
1311# ifndef ANA_WWAVE
1312 IF (.not.
destroy(ng, forces(ng)%Dissip_rollerG, myfile, &
1313 & __line__, 'FORCES(ng)%Dissip_rollerG')) RETURN
1314 IF (.not.
destroy(ng, forces(ng)%rollAG, myfile, &
1315 & __line__, 'FORCES(ng)%rollAG')) RETURN
1316# endif
1317# endif
1318
1319# if defined ROLLER_SVENDSEN
1320 IF (.not.
destroy(ng, forces(ng)%wave_break, myfile, &
1321 & __line__, 'FORCES(ng)%wave_break')) RETURN
1322# ifndef ANA_WWAVE
1323 IF (.not.
destroy(ng, forces(ng)%Wave_breakG, myfile, &
1324 & __line__, 'FORCES(ng)%Wave_breakG')) RETURN
1325# endif
1326# endif
1327
1328# if defined WAVES_DSPR
1329 IF (.not.
destroy(ng, forces(ng)%Wave_ds, myfile, &
1330 & __line__, 'FORCES(ng)%Wave_ds')) RETURN
1331 IF (.not.
destroy(ng, forces(ng)%Wave_qp, myfile, &
1332 & __line__, 'FORCES(ng)%Wave_qp')) RETURN
1333# ifndef ANA_WWAVE
1334 IF (.not.
destroy(ng, forces(ng)%Wave_dsG, myfile, &
1335 & __line__, 'FORCES(ng)%Wwave_dsG')) RETURN
1336 IF (.not.
destroy(ng, forces(ng)%Wave_qpG, myfile, &
1337 & __line__, 'FORCES(ng)%Wave_qpG')) RETURN
1338# endif
1339# endif
1340
1341# ifdef SPECTRUM_STOKES
1342 IF (.not.
destroy(ng, forces(ng)%spec_wn, myfile, &
1343 & __line__, 'FORCES(ng)%spec_wn')) RETURN
1344 IF (.not.
destroy(ng, forces(ng)%spec_us, myfile, &
1345 & __line__, 'FORCES(ng)%spec_us')) RETURN
1346 IF (.not.
destroy(ng, forces(ng)%spec_vs, myfile, &
1347 & __line__, 'FORCES(ng)%spec_vs')) RETURN
1348# endif
1349
1350# ifdef SOLVE3D
1351
1352# ifdef SHORTWAVE
1353 IF (.not.
destroy(ng, forces(ng)%srflx, myfile, &
1354 & __line__, 'FORCES(ng)%srflx')) RETURN
1355# ifndef ANA_SRFLUX
1356 IF (.not.
destroy(ng, forces(ng)%srflxG, myfile, &
1357 & __line__, 'FORCES(ng)%srflxG')) RETURN
1358# endif
1359
1360# ifdef ICE_ALBEDO
1361 IF (.not.
destroy(ng, forces(ng)%albedo, myfile, &
1362 & __line__, 'FORCES(ng)%albedo')) RETURN
1363# ifdef ICE_MODEL
1364 IF (.not.
destroy(ng, forces(ng)%albedo_ice, myfile, &
1365 & __line__, 'FORCES(ng)%albedo_ice')) RETURN
1366# endif
1367# endif
1368# endif
1369
1370# if defined RED_TIDE && defined DAILY_SHORTWAVE
1371 IF (.not.
destroy(ng, forces(ng)%srflx_avg, myfile, &
1372 & __line__, 'FORCES(ng)%srflx_avg')) RETURN
1373
1374 IF (.not.
destroy(ng, forces(ng)%srflxG_avg, myfile, &
1375 & __line__, 'FORCES(ng)%srflxG_avg')) RETURN
1376# endif
1377
1378# ifdef CLOUDS
1379 IF (.not.
destroy(ng, forces(ng)%cloud, myfile, &
1380 & __line__, 'FORCES(ng)%cloud')) RETURN
1381# ifndef ANA_CLOUD
1382 IF (.not.
destroy(ng, forces(ng)%cloudG, myfile, &
1383 & __line__, 'FORCES(ng)%cloudG')) RETURN
1384# endif
1385# endif
1386
1387# if defined BULK_FLUXES || defined FRC_COUPLING
1388 IF (.not.
destroy(ng, forces(ng)%lhflx, myfile, &
1389 & __line__, 'FORCES(ng)%lhflx')) RETURN
1390
1391 IF (.not.
destroy(ng, forces(ng)%lrflx, myfile, &
1392 & __line__, 'FORCES(ng)%lrflx')) RETURN
1393
1394 IF (.not.
destroy(ng, forces(ng)%shflx, myfile, &
1395 & __line__, 'FORCES(ng)%shflx')) RETURN
1396# endif
1397
1398# if !defined LONGWAVE && defined BULK_FLUXES
1399 IF (.not.
destroy(ng, forces(ng)%lrflxG, myfile, &
1400 & __line__, 'FORCES(ng)%lrflxG')) RETURN
1401# endif
1402
1403# if defined BULK_FLUXES || defined ECOSIM || \
1404 (defined shortwave && defined ana_srflux) || \
1405 defined spectral_light
1406 IF (.not.
destroy(ng, forces(ng)%Hair, myfile, &
1407 & __line__, 'FORCES(ng)%Hair')) RETURN
1408
1409# ifndef ANA_HUMIDITY
1410 IF (.not.
destroy(ng, forces(ng)%HairG, myfile, &
1411 & __line__, 'FORCES(ng)%HairG')) RETURN
1412# endif
1413
1414 IF (.not.
destroy(ng, forces(ng)%Tair, myfile, &
1415 & __line__, 'FORCES(ng)%Tair')) RETURN
1416
1417# ifndef ANA_TAIR
1418 IF (.not.
destroy(ng, forces(ng)%TairG, myfile, &
1419 & __line__, 'FORCES(ng)%TairG')) RETURN
1420# endif
1421# endif
1422
1423# if defined BULK_FLUXES || defined ECOSIM || \
1424 defined spectral_light
1425 IF (.not.
destroy(ng, forces(ng)%Uwind, myfile, &
1426 & __line__, 'FORCES(ng)%Uwind')) RETURN
1427
1428 IF (.not.
destroy(ng, forces(ng)%Vwind, myfile, &
1429 & __line__, 'FORCES(ng)%Vwind')) RETURN
1430
1431# ifndef ANA_WINDS
1432 IF (.not.
destroy(ng, forces(ng)%UwindG, myfile, &
1433 & __line__, 'FORCES(ng)%UwindG')) RETURN
1434
1435 IF (.not.
destroy(ng, forces(ng)%VwindG, myfile, &
1436 & __line__, 'FORCES(ng)%VwindG')) RETURN
1437# endif
1438# endif
1439
1440# ifdef BULK_FLUXES
1441 IF (.not.
destroy(ng, forces(ng)%rain, myfile, &
1442 & __line__, 'FORCES(ng)%rain')) RETURN
1443
1444# ifndef ANA_RAIN
1445 IF (.not.
destroy(ng, forces(ng)%rainG, myfile, &
1446 & __line__, 'FORCES(ng)%rainG')) RETURN
1447# endif
1448
1449# ifdef EMINUSP
1450 IF (.not.
destroy(ng, forces(ng)%evap, myfile, &
1451 & __line__, 'FORCES(ng)%evap')) RETURN
1452# endif
1453# endif
1454
1455# if defined ICE_MODEL && \
1456 defined ice_bulk_fluxes && defined bulk_fluxes
1457 IF (.not.
destroy(ng, forces(ng)%Qnet_ai, myfile, &
1458 & __line__, 'FORCES(ng)%Qnet_ai')) RETURN
1459
1460 IF (.not.
destroy(ng, forces(ng)%Qnet_ao, myfile, &
1461 & __line__, 'FORCES(ng)%Qnet_ao')) RETURN
1462
1463 IF (.not.
destroy(ng, forces(ng)%snow, myfile, &
1464 & __line__, 'FORCES(ng)%snow')) RETURN
1465
1466 IF (.not.
destroy(ng, forces(ng)%srflx_ice, myfile, &
1467 & __line__, 'FORCES(ng)%srflx_ice')) RETURN
1468
1469 IF (.not.
destroy(ng, forces(ng)%sustr_ai, myfile, &
1470 & __line__, 'FORCES(ng)%sustr_ai')) RETURN
1471
1472 IF (.not.
destroy(ng, forces(ng)%svstr_ai, myfile, &
1473 & __line__, 'FORCES(ng)%svstr_ai')) RETURN
1474
1475 IF (.not.
destroy(ng, forces(ng)%sustr_ao, myfile, &
1476 & __line__, 'FORCES(ng)%sustr_ao')) RETURN
1477
1478 IF (.not.
destroy(ng, forces(ng)%svstr_ao, myfile, &
1479 & __line__, 'FORCES(ng)%svstr_ao')) RETURN
1480# endif
1481
1482 IF (.not.
destroy(ng, forces(ng)%stflux, myfile, &
1483 & __line__, 'FORCES(ng)%stflux')) RETURN
1484
1485# if !defined ANA_STFLUX || !defined ANA_SSFLUX || \
1486
1487 IF (.not.
destroy(ng, forces(ng)%stfluxG, myfile, &
1488 & __line__, 'FORCES(ng)%stfluxG')) RETURN
1489# endif
1490
1491 IF (.not.
destroy(ng, forces(ng)%stflx, myfile, &
1492 & __line__, 'FORCES(ng)%stflx')) RETURN
1493
1494# ifdef ADJUST_STFLUX
1495 IF (.not.
destroy(ng, forces(ng)%tflux, myfile, &
1496 & __line__, 'FORCES(ng)%tflux')) RETURN
1497# endif
1498
1499 IF (.not.
destroy(ng, forces(ng)%btflux, myfile, &
1500 & __line__, 'FORCES(ng)%btflux')) RETURN
1501
1502# if !defined ANA_BTFLUX || !defined ANA_BSFLUX || \
1503
1504 IF (.not.
destroy(ng, forces(ng)%btfluxG, myfile, &
1505 & __line__, 'FORCES(ng)%btfluxG')) RETURN
1506# endif
1507
1508 IF (.not.
destroy(ng, forces(ng)%btflx, myfile, &
1509 & __line__, 'FORCES(ng)%btflx')) RETURN
1510
1511# ifdef QCORRECTION
1512 IF (.not.
destroy(ng, forces(ng)%dqdt, myfile, &
1513 & __line__, 'FORCES(ng)%dqdt')) RETURN
1514
1515 IF (.not.
destroy(ng, forces(ng)%sst, myfile, &
1516 & __line__, 'FORCES(ng)%sst')) RETURN
1517
1518# ifndef ANA_SST
1519 IF (.not.
destroy(ng, forces(ng)%dqdtG, myfile, &
1520 & __line__, 'FORCES(ng)%dqdtG')) RETURN
1521
1522 IF (.not.
destroy(ng, forces(ng)%sstG, myfile, &
1523 & __line__, 'FORCES(ng)%sstG')) RETURN
1524# endif
1525# endif
1526
1527# if defined SALINITY && (defined SCORRECTION || defined SRELAXATION)
1528 IF (.not.
destroy(ng, forces(ng)%sss, myfile, &
1529 & __line__, 'FORCES(ng)%sss')) RETURN
1530
1531# ifndef ANA_SSS
1532 IF (.not.
destroy(ng, forces(ng)%sssG, myfile, &
1533 & __line__, 'FORCES(ng)%sssG')) RETURN
1534# endif
1535# endif
1536
1537# if defined ECOSIM || defined SPECTRAL_LIGHT
1538 IF (.not.
destroy(ng, forces(ng)%SpecIr, myfile, &
1539 & __line__, 'FORCES(ng)%SpecIr')) RETURN
1540
1541 IF (.not.
destroy(ng, forces(ng)%avcos, myfile, &
1542 & __line__, 'FORCES(ng)%avcos')) RETURN
1543# endif
1544
1545# endif
1546
1547# if defined TANGENT || defined TL_IOMS
1548
1549
1550
1551 IF (.not.
destroy(ng, forces(ng)%tl_sustr, myfile, &
1552 & __line__, 'FORCES(ng)%tl_sustr')) RETURN
1553
1554 IF (.not.
destroy(ng, forces(ng)%tl_svstr, myfile, &
1555 & __line__, 'FORCES(ng)%tl_svstr')) RETURN
1556
1557# ifdef ADJUST_WSTRESS
1558 IF (.not.
destroy(ng, forces(ng)%tl_ustr, myfile, &
1559 & __line__, 'FORCES(ng)%tl_ustr')) RETURN
1560
1561 IF (.not.
destroy(ng, forces(ng)%tl_vstr, myfile, &
1562 & __line__, 'FORCES(ng)%tl_vstr')) RETURN
1563# endif
1564
1565 IF (.not.
destroy(ng, forces(ng)%tl_bustr, myfile, &
1566 & __line__, 'FORCES(ng)%tl_bustr')) RETURN
1567
1568 IF (.not.
destroy(ng, forces(ng)%tl_bvstr, myfile, &
1569 & __line__, 'FORCES(ng)%tl_bvstr')) RETURN
1570
1571# ifdef SOLVE3D
1572 IF (.not.
destroy(ng, forces(ng)%tl_stflux, myfile, &
1573 & __line__, 'FORCES(ng)%tl_stflux')) RETURN
1574
1575 IF (.not.
destroy(ng, forces(ng)%tl_stflx, myfile, &
1576 & __line__, 'FORCES(ng)%tl_stflx')) RETURN
1577
1578 IF (.not.
destroy(ng, forces(ng)%tl_btflux, myfile, &
1579 & __line__, 'FORCES(ng)%tl_btflux')) RETURN
1580
1581 IF (.not.
destroy(ng, forces(ng)%tl_btflx, myfile, &
1582 & __line__, 'FORCES(ng)%tl_btflx')) RETURN
1583
1584# ifdef ADJUST_STFLUX
1585 IF (.not.
destroy(ng, forces(ng)%tl_tflux, myfile, &
1586 & __line__, 'FORCES(ng)%tl_tflux')) RETURN
1587# endif
1588
1589# ifdef SHORTWAVE
1590 IF (.not.
destroy(ng, forces(ng)%tl_srflx, myfile, &
1591 & __line__, 'FORCES(ng)%tl_srflx')) RETURN
1592# endif
1593
1594# ifdef BULK_FLUXES
1595 IF (.not.
destroy(ng, forces(ng)%tl_lhflx, myfile, &
1596 & __line__, 'FORCES(ng)%tl_lhflx')) RETURN
1597
1598 IF (.not.
destroy(ng, forces(ng)%tl_lrflx, myfile, &
1599 & __line__, 'FORCES(ng)%tl_lrflx')) RETURN
1600
1601 IF (.not.
destroy(ng, forces(ng)%tl_shflx, myfile, &
1602 & __line__, 'FORCES(ng)%tl_shflx')) RETURN
1603
1604# ifdef EMINUSP
1605 IF (.not.
destroy(ng, forces(ng)%tl_evap, myfile, &
1606 & __line__, 'FORCES(ng)%tl_evap')) RETURN
1607# endif
1608# endif
1609# endif
1610# endif
1611
1612# ifdef ADJOINT
1613
1614
1615
1616 IF (.not.
destroy(ng, forces(ng)%ad_sustr, myfile, &
1617 & __line__, 'FORCES(ng)%ad_sustr')) RETURN
1618
1619 IF (.not.
destroy(ng, forces(ng)%ad_svstr, myfile, &
1620 & __line__, 'FORCES(ng)%ad_svstr')) RETURN
1621
1622# ifdef ADJUST_WSTRESS
1623 IF (.not.
destroy(ng, forces(ng)%ad_ustr, myfile, &
1624 & __line__, 'FORCES(ng)%ad_ustr')) RETURN
1625
1626 IF (.not.
destroy(ng, forces(ng)%ad_vstr, myfile, &
1627 & __line__, 'FORCES(ng)%ad_vstr')) RETURN
1628# endif
1629
1630 IF (.not.
destroy(ng, forces(ng)%ad_bustr, myfile, &
1631 & __line__, 'FORCES(ng)%ad_bustr')) RETURN
1632
1633 IF (.not.
destroy(ng, forces(ng)%ad_bvstr, myfile, &
1634 & __line__, 'FORCES(ng)%ad_bvstr')) RETURN
1635
1636 IF (.not.
destroy(ng, forces(ng)%ad_bustr_sol, myfile, &
1637 & __line__, 'FORCES(ng)%ad_bustr_sol')) RETURN
1638
1639 IF (.not.
destroy(ng, forces(ng)%ad_bvstr_sol, myfile, &
1640 & __line__, 'FORCES(ng)%ad_bvstr_sol')) RETURN
1641
1642# ifdef SOLVE3D
1643 IF (.not.
destroy(ng, forces(ng)%ad_stflx, myfile, &
1644 & __line__, 'FORCES(ng)%ad_stflx')) RETURN
1645
1646 IF (.not.
destroy(ng, forces(ng)%ad_btflx, myfile, &
1647 & __line__, 'FORCES(ng)%ad_btflx')) RETURN
1648
1649# ifdef ADJUST_STFLUX
1650 IF (.not.
destroy(ng, forces(ng)%ad_tflux, myfile, &
1651 & __line__, 'FORCES(ng)%ad_tflux')) RETURN
1652# endif
1653
1654# ifdef SHORTWAVE
1655 IF (.not.
destroy(ng, forces(ng)%ad_srflx, myfile, &
1656 & __line__, 'FORCES(ng)%ad_srflx')) RETURN
1657# endif
1658
1659# ifdef BULK_FLUXES
1660 IF (.not.
destroy(ng, forces(ng)%ad_lhflx, myfile, &
1661 & __line__, 'FORCES(ng)%ad_lhflx')) RETURN
1662
1663 IF (.not.
destroy(ng, forces(ng)%ad_lrflx, myfile, &
1664 & __line__, 'FORCES(ng)%ad_lrflx')) RETURN
1665
1666 IF (.not.
destroy(ng, forces(ng)%ad_shflx, myfile, &
1667 & __line__, 'FORCES(ng)%ad_shflx')) RETURN
1668
1669# ifdef EMINUSP
1670 IF (.not.
destroy(ng, forces(ng)%ad_evap, myfile, &
1671 & __line__, 'FORCES(ng)%ad_evap')) RETURN
1672# endif
1673# endif
1674# endif
1675# endif
1676
1677# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
1678
1679
1680
1681
1682
1683# if defined FOUR_DVAR || defined IMPULSE
1684# ifdef ADJUST_WSTRESS
1685 IF (.not.
destroy(ng, forces(ng)%b_sustr, myfile, &
1686 & __line__, 'FORCES(ng)%b_sustr')) RETURN
1687
1688 IF (.not.
destroy(ng, forces(ng)%b_svstr, myfile, &
1689 & __line__, 'FORCES(ng)%b_svstr')) RETURN
1690# endif
1691
1692# if defined ADJUST_STFLUX && defined SOLVE3D
1693 IF (.not.
destroy(ng, forces(ng)%b_stflx, myfile, &
1694 & __line__, 'FORCES(ng)%b_stflx')) RETURN
1695# endif
1696# endif
1697
1698# ifdef FOUR_DVAR
1699# ifdef ADJUST_WSTRESS
1700 IF (.not.
destroy(ng, forces(ng)%d_sustr, myfile, &
1701 & __line__, 'FORCES(ng)%d_sustr')) RETURN
1702
1703 IF (.not.
destroy(ng, forces(ng)%d_svstr, myfile, &
1704 & __line__, 'FORCES(ng)%d_svstr')) RETURN
1705
1706 IF (.not.
destroy(ng, forces(ng)%e_sustr, myfile, &
1707 & __line__, 'FORCES(ng)%e_sustr')) RETURN
1708
1709 IF (.not.
destroy(ng, forces(ng)%e_svstr, myfile, &
1710 & __line__, 'FORCES(ng)%e_svstr')) RETURN
1711# endif
1712
1713# if defined ADJUST_STFLUX && defined SOLVE3D
1714 IF (.not.
destroy(ng, forces(ng)%d_stflx, myfile, &
1715 & __line__, 'FORCES(ng)%d_stflx')) RETURN
1716
1717 IF (.not.
destroy(ng, forces(ng)%e_stflx, myfile, &
1718 & __line__, 'FORCES(ng)%e_stflx')) RETURN
1719# endif
1720# endif
1721# endif
1722#endif
1723
1724
1725
1726
1727
1729 IF (allocated(forces)) deallocate ( forces )
1730 END IF
1731
1732 RETURN