50 #include<file_version.h> 144 real,
dimension(:),
allocatable ::
table 145 real,
dimension(:),
allocatable ::
dtable 147 real,
dimension(:),
allocatable ::
table2 150 real,
dimension(:),
allocatable ::
table3 160 use_exact_qs_input, do_simple, &
161 construct_table_wrt_liq, &
162 construct_table_wrt_liq_and_ice, &
167 integer,
intent(in) :: table_size
168 real,
intent(in) :: tcmin
169 real,
intent(in) :: tcmax
170 real,
intent(in) :: tfreeze, hlv, rvgas, es0
171 logical,
intent(in) :: use_exact_qs_input, do_simple
172 logical,
intent(in) :: construct_table_wrt_liq
173 logical,
intent(in) :: construct_table_wrt_liq_and_ice
174 character(len=*),
intent(out) :: err_msg
175 real,
intent(out),
optional :: teps, tmin, dtinv
178 real,
dimension(3) :: tem(3), es(3)
179 real :: hdtinv, tinrc, tfact
187 err_msg =
'Attempt to allocate sat vapor pressure tables when already allocated' 193 if (construct_table_wrt_liq)
then 195 err_msg =
'Attempt to allocate sat vapor pressure table2s when already allocated' 202 if (construct_table_wrt_liq_and_ice)
then 204 err_msg =
'Attempt to allocate sat vapor pressure table2s when already allocated' 212 dtres = (tcmax - tcmin)/
real(table_size-1)
213 tminl =
real(tcmin)+tfreeze
217 if(
present(teps )) teps =
tepsl 218 if(
present(tmin )) tmin =
tminl 219 if(
present(dtinv)) dtinv=
dtinvl 235 table(i) = es0*610.78*exp(-hlv/rvgas*(1./tem(1) - 1./tfreeze))
243 tem(2) = tem(1)-tinrc
244 tem(3) = tem(1)+tinrc
247 dtable(i) = (es(3)-es(2))*tfact
255 do i = 2, table_size-1
265 if (construct_table_wrt_liq)
then 271 tem(2) = tem(1)-tinrc
272 tem(3) = tem(1)+tinrc
276 dtable2(i) = (es(3)-es(2))*tfact
282 do i = 2, table_size-1
294 if (construct_table_wrt_liq_and_ice)
then 300 tem(2) = tem(1)-tinrc
301 tem(3) = tem(1)+tinrc
305 dtable3(i) = (es(3)-es(2))*tfact
311 do i = 2, table_size-1
330 real,
intent(in) :: tem(:), tfreeze
331 real :: es(
size(tem,1))
333 real :: x, esice, esh2o, tbasw, tbasi
335 real,
parameter :: esbasw = 101324.60
336 real,
parameter :: esbasi = 610.71
345 if (tem(i) < tbasi)
then 346 x = -9.09718*(tbasi/tem(i)-1.0) - 3.56654*log10(tbasi/tem(i)) &
347 +0.876793*(1.0-tem(i)/tbasi) + log10(esbasi)
357 if (tem(i) > -20.+tbasi)
then 358 x = -7.90298*(tbasw/tem(i)-1.0) + 5.02808*log10(tbasw/tem(i)) &
359 -1.3816e-07*(10.0**((1.0-tem(i)/tbasw)*11.344)-1.0) &
360 +8.1328e-03*(10.0**((tbasw/tem(i)-1.0)*(-3.49149))-1.0) &
369 if (tem(i) <= -20.+tbasi)
then 371 else if (tem(i) >= tbasi)
then 374 es(i) = 0.05*((tbasi-tem(i))*esice + (tem(i)-tbasi+20.)*esh2o)
384 real,
intent(in) :: tem(:), tfreeze
385 real :: es(
size(tem,1))
387 real :: x, esh2o, tbasw
389 real,
parameter :: esbasw = 101324.60
400 x = -7.90298*(tbasw/tem(i)-1.0) + 5.02808*log10(tbasw/tem(i)) &
401 -1.3816e-07*(10.0**((1.0-tem(i)/tbasw)*11.344)-1.0) &
402 +8.1328e-03*(10.0**((tbasw/tem(i)-1.0)*(-3.49149))-1.0) &
416 real,
intent(in) :: tem(:), tfreeze
417 real :: es(
size(tem,1))
419 real :: x, tbasw, tbasi
421 real,
parameter :: esbasw = 101324.60
422 real,
parameter :: esbasi = 610.71
429 if (tem(i) < tbasi)
then 433 x = -9.09718*(tbasi/tem(i)-1.0) - 3.56654*log10(tbasi/tem(i)) &
434 +0.876793*(1.0-tem(i)/tbasi) + log10(esbasi)
442 x = -7.90298*(tbasw/tem(i)-1.0) + 5.02808*log10(tbasw/tem(i)) &
443 -1.3816e-07*(10.0**((1.0-tem(i)/tbasw)*11.344)-1.0) &
444 +8.1328e-03*(10.0**((tbasw/tem(i)-1.0)*(-3.49149))-1.0) &
456 dqsdT, esat, es_over_liq, es_over_liq_and_ice)
458 real,
intent(in),
dimension(:,:,:) :: temp, press
459 real,
intent(in) :: eps, zvir
460 real,
intent(out),
dimension(:,:,:) :: qs
461 integer,
intent(out) :: nbad
462 real,
intent(in),
dimension(:,:,:),
optional :: q
463 real,
intent(in),
optional :: hc
464 real,
intent(out),
dimension(:,:,:),
optional :: dqsdT, esat
465 logical,
intent(in),
optional :: es_over_liq
466 logical,
intent(in),
optional :: es_over_liq_and_ice
468 real,
dimension(size(temp,1), size(temp,2), size(temp,3)) :: &
473 if (
present(hc))
then 478 if (
present(es_over_liq))
then 479 if (
present (dqsdt))
then 485 else if (
present(es_over_liq_and_ice))
then 486 if (
present (dqsdt))
then 493 if (
present (dqsdt))
then 501 if (
present (esat))
then 506 qs = (1.0 + zvir*q)*eps*esloc/press
507 if (
present (dqsdt))
then 508 dqsdt = (1.0 + zvir*q)*eps*desat/press
511 denom = press - (1.0 - eps)*esloc
515 if (denom(i,j,k) > 0.0)
then 516 qs(i,j,k) = eps*esloc(i,j,k)/denom(i,j,k)
523 if (
present (dqsdt))
then 524 dqsdt = eps*press*desat/denom**2
529 if (
present (dqsdt))
then 532 if (
present (esat))
then 543 dqsdT, esat, es_over_liq, es_over_liq_and_ice)
545 real,
intent(in),
dimension(:,:) :: temp, press
546 real,
intent(in) :: eps, zvir
547 real,
intent(out),
dimension(:,:) :: qs
548 integer,
intent(out) :: nbad
549 real,
intent(in),
dimension(:,:),
optional :: q
550 real,
intent(in),
optional :: hc
551 real,
intent(out),
dimension(:,:),
optional :: dqsdT, esat
552 logical,
intent(in),
optional :: es_over_liq
553 logical,
intent(in),
optional :: es_over_liq_and_ice
555 real,
dimension(size(temp,1), size(temp,2)) :: esloc, desat, denom
559 if (
present(hc))
then 565 if (
present(es_over_liq))
then 566 if (
present (dqsdt))
then 572 else if (
present(es_over_liq_and_ice))
then 573 if (
present (dqsdt))
then 580 if (
present (dqsdt))
then 588 if (
present (esat))
then 593 qs = (1.0 + zvir*q)*eps*esloc/press
594 if (
present (dqsdt))
then 595 dqsdt = (1.0 + zvir*q)*eps*desat/press
598 denom = press - (1.0 - eps)*esloc
601 if (denom(i,j) > 0.0)
then 602 qs(i,j) = eps*esloc(i,j)/denom(i,j)
608 if (
present (dqsdt))
then 609 dqsdt = eps*press*desat/denom**2
614 if (
present (dqsdt))
then 617 if (
present (esat))
then 628 dqsdT, esat, es_over_liq, es_over_liq_and_ice)
630 real,
intent(in),
dimension(:) :: temp, press
631 real,
intent(in) :: eps, zvir
632 real,
intent(out),
dimension(:) :: qs
633 integer,
intent(out) :: nbad
634 real,
intent(in),
dimension(:),
optional :: q
635 real,
intent(in),
optional :: hc
636 real,
intent(out),
dimension(:),
optional :: dqsdT, esat
637 logical,
intent(in),
optional :: es_over_liq
638 logical,
intent(in),
optional :: es_over_liq_and_ice
640 real,
dimension(size(temp,1)) :: esloc, desat, denom
644 if (
present(hc))
then 650 if (
present(es_over_liq))
then 651 if (
present (dqsdt))
then 657 else if (
present(es_over_liq_and_ice))
then 658 if (
present (dqsdt))
then 665 if (
present (dqsdt))
then 673 if (
present (esat))
then 678 qs = (1.0 + zvir*q)*eps*esloc/press
679 if (
present (dqsdt))
then 680 dqsdt = (1.0 + zvir*q)*eps*desat/press
683 denom = press - (1.0 - eps)*esloc
685 if (denom(i) > 0.0)
then 686 qs(i) = eps*esloc(i)/denom(i)
691 if (
present (dqsdt))
then 692 dqsdt = eps*press*desat/denom**2
697 if (
present (dqsdt))
then 700 if (
present (esat))
then 711 dqsdT, esat, es_over_liq, es_over_liq_and_ice)
713 real,
intent(in) :: temp, press
714 real,
intent(in) :: eps, zvir
715 real,
intent(out) :: qs
716 integer,
intent(out) :: nbad
717 real,
intent(in),
optional :: q
718 real,
intent(in),
optional :: hc
719 real,
intent(out),
optional :: dqsdT, esat
720 logical,
intent(in),
optional :: es_over_liq
721 logical,
intent(in),
optional :: es_over_liq_and_ice
723 real :: esloc, desat, denom
726 if (
present(hc))
then 732 if (
present(es_over_liq))
then 733 if (
present (dqsdt))
then 739 else if (
present(es_over_liq_and_ice))
then 740 if (
present (dqsdt))
then 747 if (
present (dqsdt))
then 755 if (
present (esat))
then 760 qs = (1.0 + zvir*q)*eps*esloc/press
761 if (
present (dqsdt))
then 762 dqsdt = (1.0 + zvir*q)*eps*desat/press
765 denom = press - (1.0 - eps)*esloc
766 if (denom > 0.0)
then 771 if (
present (dqsdt))
then 772 dqsdt = eps*press*desat/denom**2
777 if (
present (dqsdt))
then 780 if (
present (esat))
then 793 mr, hc, dmrsdT, esat,es_over_liq, es_over_liq_and_ice)
795 real,
intent(in),
dimension(:,:,:) :: temp, press
796 real,
intent(in) :: eps, zvir
797 real,
intent(out),
dimension(:,:,:) :: mrs
798 integer,
intent(out) :: nbad
799 real,
intent(in),
dimension(:,:,:),
optional :: mr
800 real,
intent(in),
optional :: hc
801 real,
intent(out),
dimension(:,:,:),
optional :: dmrsdT, esat
802 logical,
intent(in),
optional :: es_over_liq
803 logical,
intent(in),
optional :: es_over_liq_and_ice
805 real,
dimension(size(temp,1), size(temp,2), size(temp,3)) :: &
810 if (
present(hc))
then 816 if (
present (es_over_liq))
then 817 if (
present (dmrsdt))
then 823 else if (
present(es_over_liq_and_ice))
then 824 if (
present (dmrsdt))
then 831 if (
present (dmrsdt))
then 839 if (
present (esat))
then 844 mrs = (eps + mr)*esloc/press
845 if (
present (dmrsdt))
then 846 dmrsdt = (eps + mr)*desat/press
849 denom = press - esloc
853 if (denom(i,j,k) > 0.0)
then 854 mrs(i,j,k) = eps*esloc(i,j,k)/denom(i,j,k)
861 if (
present (dmrsdt))
then 862 dmrsdt = eps*press*desat/denom**2
867 if (
present (dmrsdt))
then 870 if (
present (esat))
then 881 mr, hc, dmrsdT, esat,es_over_liq, es_over_liq_and_ice)
883 real,
intent(in),
dimension(:,:) :: temp, press
884 real,
intent(in) :: eps, zvir
885 real,
intent(out),
dimension(:,:) :: mrs
886 integer,
intent(out) :: nbad
887 real,
intent(in),
dimension(:,:),
optional :: mr
888 real,
intent(in),
optional :: hc
889 real,
intent(out),
dimension(:,:),
optional :: dmrsdT, esat
890 logical,
intent(in),
optional :: es_over_liq
891 logical,
intent(in),
optional :: es_over_liq_and_ice
893 real,
dimension(size(temp,1), size(temp,2)) :: esloc, desat, denom
897 if (
present(hc))
then 903 if (
present (es_over_liq))
then 904 if (
present (dmrsdt))
then 910 else if (
present(es_over_liq_and_ice))
then 911 if (
present (dmrsdt))
then 918 if (
present (dmrsdt))
then 926 if (
present (esat))
then 931 mrs = (eps + mr)*esloc/press
932 if (
present (dmrsdt))
then 933 dmrsdt = (eps + mr)*desat/press
936 denom = press - esloc
939 if (denom(i,j) > 0.0)
then 940 mrs(i,j) = eps*esloc(i,j)/denom(i,j)
946 if (
present (dmrsdt))
then 947 dmrsdt = eps*press*desat/denom**2
952 if (
present (dmrsdt))
then 955 if (
present (esat))
then 966 mr, hc, dmrsdT, esat,es_over_liq, es_over_liq_and_ice)
968 real,
intent(in),
dimension(:) :: temp, press
969 real,
intent(in) :: eps, zvir
970 real,
intent(out),
dimension(:) :: mrs
971 integer,
intent(out) :: nbad
972 real,
intent(in),
dimension(:),
optional :: mr
973 real,
intent(in),
optional :: hc
974 real,
intent(out),
dimension(:),
optional :: dmrsdT, esat
975 logical,
intent(in),
optional :: es_over_liq
976 logical,
intent(in),
optional :: es_over_liq_and_ice
978 real,
dimension(size(temp,1)) :: esloc, desat, denom
982 if (
present(hc))
then 988 if (
present (es_over_liq))
then 989 if (
present (dmrsdt))
then 995 else if (
present(es_over_liq_and_ice))
then 996 if (
present (dmrsdt))
then 1003 if (
present (dmrsdt))
then 1005 desat = desat*hc_loc
1010 esloc = esloc*hc_loc
1011 if (
present (esat))
then 1016 mrs = (eps + mr)*esloc/press
1017 if (
present (dmrsdt))
then 1018 dmrsdt = (eps + mr)*desat/press
1021 denom = press - esloc
1023 if (denom(i) > 0.0)
then 1024 mrs(i) = eps*esloc(i)/denom(i)
1029 if (
present (dmrsdt))
then 1030 dmrsdt = eps*press*desat/denom**2
1035 if (
present (dmrsdt))
then 1038 if (
present (esat))
then 1049 mr, hc, dmrsdT, esat,es_over_liq, es_over_liq_and_ice)
1051 real,
intent(in) :: temp, press
1052 real,
intent(in) :: eps, zvir
1053 real,
intent(out) :: mrs
1054 integer,
intent(out) :: nbad
1055 real,
intent(in),
optional :: mr
1056 real,
intent(in),
optional :: hc
1057 real,
intent(out),
optional :: dmrsdT, esat
1058 logical,
intent(in),
optional :: es_over_liq
1059 logical,
intent(in),
optional :: es_over_liq_and_ice
1061 real :: esloc, desat, denom
1064 if (
present(hc))
then 1070 if (
present (es_over_liq))
then 1071 if (
present (dmrsdt))
then 1073 desat = desat*hc_loc
1077 else if (
present(es_over_liq_and_ice))
then 1078 if (
present (dmrsdt))
then 1080 desat = desat*hc_loc
1085 if (
present (dmrsdt))
then 1087 desat = desat*hc_loc
1092 esloc = esloc*hc_loc
1093 if (
present (esat))
then 1098 mrs = (eps + mr)*esloc/press
1099 if (
present (dmrsdt))
then 1100 dmrsdt = (eps + mr)*desat/press
1103 denom = press - esloc
1104 if (denom > 0.0)
then 1105 mrs = eps*esloc/denom
1109 if (
present (dmrsdt))
then 1110 dmrsdt = eps*press*desat/denom**2
1115 if (
present (dmrsdt))
then 1118 if (
present (esat))
then 1131 real,
intent(in),
dimension(:,:,:) :: temp
1132 real,
intent(out),
dimension(:,:,:) :: esat, desat
1133 integer,
intent(out) :: nbad
1136 integer :: ind, i, j, k
1139 do k = 1,
size(temp,3)
1140 do j = 1,
size(temp,2)
1141 do i = 1,
size(temp,1)
1142 tmp = temp(i,j,k)-
tminl 1147 del = tmp-
dtres*
real(ind)
1148 esat(i,j,k) =
table(ind+1) + &
1161 real,
intent(in),
dimension(:,:) :: temp
1162 real,
intent(out),
dimension(:,:) :: esat, desat
1163 integer,
intent(out) :: nbad
1166 integer :: ind, i, j
1169 do j = 1,
size(temp,2)
1170 do i = 1,
size(temp,1)
1171 tmp = temp(i,j)-
tminl 1176 del = tmp-
dtres*
real(ind)
1177 esat(i,j) =
table(ind+1) + &
1189 real,
intent(in),
dimension(:) :: temp
1190 real,
intent(out),
dimension(:) :: esat, desat
1191 integer,
intent(out) :: nbad
1197 do i = 1,
size(temp,1)
1203 del = tmp-
dtres*
real(ind)
1204 esat(i) =
table(ind+1) + &
1215 real,
intent(in) :: temp
1216 real,
intent(out) :: esat, desat
1217 integer,
intent(out) :: nbad
1228 del = tmp-
dtres*
real(ind)
1229 esat =
table(ind+1) + &
1239 real,
intent(in),
dimension(:,:,:) :: temp
1240 real,
intent(out),
dimension(:,:,:) :: esat
1241 integer,
intent(out) :: nbad
1243 integer :: ind, i, j, k
1246 do k = 1,
size(temp,3)
1247 do j = 1,
size(temp,2)
1248 do i = 1,
size(temp,1)
1249 tmp = temp(i,j,k)-
tminl 1254 del = tmp-
dtres*
real(ind)
1255 esat(i,j,k) =
table(ind+1) + &
1267 real,
intent(in),
dimension(:,:,:) :: temp
1268 real,
intent(out),
dimension(:,:,:) :: desat
1269 integer,
intent(out) :: nbad
1271 integer :: ind, i, j, k
1274 do k = 1,
size(temp,3)
1275 do j = 1,
size(temp,2)
1276 do i = 1,
size(temp,1)
1277 tmp = temp(i,j,k)-
tminl 1282 del = tmp-
dtres*
real(ind)
1293 real,
intent(in),
dimension(:,:) :: temp
1294 real,
intent(out),
dimension(:,:) :: desat
1295 integer,
intent(out) :: nbad
1297 integer :: ind, i, j
1300 do j = 1,
size(temp,2)
1301 do i = 1,
size(temp,1)
1302 tmp = temp(i,j)-
tminl 1307 del = tmp-
dtres*
real(ind)
1316 real,
intent(in),
dimension(:,:) :: temp
1317 real,
intent(out),
dimension(:,:) :: esat
1318 integer,
intent(out) :: nbad
1320 integer :: ind, i, j
1323 do j = 1,
size(temp,2)
1324 do i = 1,
size(temp,1)
1325 tmp = temp(i,j)-
tminl 1330 del = tmp-
dtres*
real(ind)
1340 real,
intent(in),
dimension(:) :: temp
1341 real,
intent(out),
dimension(:) :: desat
1342 integer,
intent(out) :: nbad
1347 do i = 1,
size(temp,1)
1353 del = tmp-
dtres*
real(ind)
1361 real,
intent(in),
dimension(:) :: temp
1362 real,
intent(out),
dimension(:) :: esat
1363 integer,
intent(out) :: nbad
1368 do i = 1,
size(temp,1)
1374 del = tmp-
dtres*
real(ind)
1382 real,
intent(in) :: temp
1383 real,
intent(out) :: desat
1384 integer,
intent(out) :: nbad
1394 del = tmp-
dtres*
real(ind)
1401 real,
intent(in) :: temp
1402 real,
intent(out) :: esat
1403 integer,
intent(out) :: nbad
1413 del = tmp-
dtres*
real(ind)
1421 real,
intent(in),
dimension(:,:,:) :: temp
1422 real,
intent(out),
dimension(:,:,:) :: esat, desat
1423 integer,
intent(out) :: nbad
1426 integer :: ind, i, j, k
1429 do k = 1,
size(temp,3)
1430 do j = 1,
size(temp,2)
1431 do i = 1,
size(temp,1)
1432 tmp = temp(i,j,k)-
tminl 1437 del = tmp-
dtres*
real(ind)
1438 esat(i,j,k) =
table2(ind+1) + &
1451 real,
intent(in),
dimension(:,:) :: temp
1452 real,
intent(out),
dimension(:,:) :: esat, desat
1453 integer,
intent(out) :: nbad
1456 integer :: ind, i, j
1459 do j = 1,
size(temp,2)
1460 do i = 1,
size(temp,1)
1461 tmp = temp(i,j)-
tminl 1466 del = tmp-
dtres*
real(ind)
1467 esat(i,j) =
table2(ind+1) + &
1479 real,
intent(in),
dimension(:) :: temp
1480 real,
intent(out),
dimension(:) :: esat, desat
1481 integer,
intent(out) :: nbad
1487 do i = 1,
size(temp,1)
1493 del = tmp-
dtres*
real(ind)
1494 esat(i) =
table2(ind+1) + &
1505 real,
intent(in) :: temp
1506 real,
intent(out) :: esat, desat
1507 integer,
intent(out) :: nbad
1518 del = tmp-
dtres*
real(ind)
1529 real,
intent(in),
dimension(:,:,:) :: temp
1530 real,
intent(out),
dimension(:,:,:) :: esat
1531 integer,
intent(out) :: nbad
1533 integer :: ind, i, j, k
1536 do k = 1,
size(temp,3)
1537 do j = 1,
size(temp,2)
1538 do i = 1,
size(temp,1)
1539 tmp = temp(i,j,k)-
tminl 1544 del = tmp-
dtres*
real(ind)
1545 esat(i,j,k) =
table2(ind+1) + &
1557 real,
intent(in),
dimension(:,:,:) :: temp
1558 real,
intent(out),
dimension(:,:,:) :: desat
1559 integer,
intent(out) :: nbad
1561 integer :: ind, i, j, k
1564 do k = 1,
size(temp,3)
1565 do j = 1,
size(temp,2)
1566 do i = 1,
size(temp,1)
1567 tmp = temp(i,j,k)-
tminl 1572 del = tmp-
dtres*
real(ind)
1583 real,
intent(in),
dimension(:,:) :: temp
1584 real,
intent(out),
dimension(:,:) :: desat
1585 integer,
intent(out) :: nbad
1587 integer :: ind, i, j
1590 do j = 1,
size(temp,2)
1591 do i = 1,
size(temp,1)
1592 tmp = temp(i,j)-
tminl 1597 del = tmp-
dtres*
real(ind)
1606 real,
intent(in),
dimension(:,:) :: temp
1607 real,
intent(out),
dimension(:,:) :: esat
1608 integer,
intent(out) :: nbad
1610 integer :: ind, i, j
1613 do j = 1,
size(temp,2)
1614 do i = 1,
size(temp,1)
1615 tmp = temp(i,j)-
tminl 1620 del = tmp-
dtres*
real(ind)
1630 real,
intent(in),
dimension(:) :: temp
1631 real,
intent(out),
dimension(:) :: desat
1632 integer,
intent(out) :: nbad
1637 do i = 1,
size(temp,1)
1643 del = tmp-
dtres*
real(ind)
1651 real,
intent(in),
dimension(:) :: temp
1652 real,
intent(out),
dimension(:) :: esat
1653 integer,
intent(out) :: nbad
1658 do i = 1,
size(temp,1)
1664 del = tmp-
dtres*
real(ind)
1672 real,
intent(in) :: temp
1673 real,
intent(out) :: desat
1674 integer,
intent(out) :: nbad
1684 del = tmp-
dtres*
real(ind)
1691 real,
intent(in) :: temp
1692 real,
intent(out) :: esat
1693 integer,
intent(out) :: nbad
1703 del = tmp-
dtres*
real(ind)
1713 real,
intent(in),
dimension(:,:,:) :: temp
1714 real,
intent(out),
dimension(:,:,:) :: esat, desat
1715 integer,
intent(out) :: nbad
1718 integer :: ind, i, j, k
1721 do k = 1,
size(temp,3)
1722 do j = 1,
size(temp,2)
1723 do i = 1,
size(temp,1)
1724 tmp = temp(i,j,k)-
tminl 1729 del = tmp-
dtres*
real(ind)
1730 esat(i,j,k) =
table3(ind+1) + &
1743 real,
intent(in),
dimension(:,:) :: temp
1744 real,
intent(out),
dimension(:,:) :: esat, desat
1745 integer,
intent(out) :: nbad
1748 integer :: ind, i, j
1751 do j = 1,
size(temp,2)
1752 do i = 1,
size(temp,1)
1753 tmp = temp(i,j)-
tminl 1758 del = tmp-
dtres*
real(ind)
1759 esat(i,j) =
table3(ind+1) + &
1771 real,
intent(in),
dimension(:) :: temp
1772 real,
intent(out),
dimension(:) :: esat, desat
1773 integer,
intent(out) :: nbad
1779 do i = 1,
size(temp,1)
1785 del = tmp-
dtres*
real(ind)
1786 esat(i) =
table3(ind+1) + &
1797 real,
intent(in) :: temp
1798 real,
intent(out) :: esat, desat
1799 integer,
intent(out) :: nbad
1810 del = tmp-
dtres*
real(ind)
1821 real,
intent(in),
dimension(:,:,:) :: temp
1822 real,
intent(out),
dimension(:,:,:) :: esat
1823 integer,
intent(out) :: nbad
1825 integer :: ind, i, j, k
1828 do k = 1,
size(temp,3)
1829 do j = 1,
size(temp,2)
1830 do i = 1,
size(temp,1)
1831 tmp = temp(i,j,k)-
tminl 1836 del = tmp-
dtres*
real(ind)
1837 esat(i,j,k) =
table3(ind+1) + &
1849 real,
intent(in),
dimension(:,:,:) :: temp
1850 real,
intent(out),
dimension(:,:,:) :: desat
1851 integer,
intent(out) :: nbad
1853 integer :: ind, i, j, k
1856 do k = 1,
size(temp,3)
1857 do j = 1,
size(temp,2)
1858 do i = 1,
size(temp,1)
1859 tmp = temp(i,j,k)-
tminl 1864 del = tmp-
dtres*
real(ind)
1875 real,
intent(in),
dimension(:,:) :: temp
1876 real,
intent(out),
dimension(:,:) :: desat
1877 integer,
intent(out) :: nbad
1879 integer :: ind, i, j
1882 do j = 1,
size(temp,2)
1883 do i = 1,
size(temp,1)
1884 tmp = temp(i,j)-
tminl 1889 del = tmp-
dtres*
real(ind)
1898 real,
intent(in),
dimension(:,:) :: temp
1899 real,
intent(out),
dimension(:,:) :: esat
1900 integer,
intent(out) :: nbad
1902 integer :: ind, i, j
1905 do j = 1,
size(temp,2)
1906 do i = 1,
size(temp,1)
1907 tmp = temp(i,j)-
tminl 1912 del = tmp-
dtres*
real(ind)
1922 real,
intent(in),
dimension(:) :: temp
1923 real,
intent(out),
dimension(:) :: desat
1924 integer,
intent(out) :: nbad
1929 do i = 1,
size(temp,1)
1935 del = tmp-
dtres*
real(ind)
1943 real,
intent(in),
dimension(:) :: temp
1944 real,
intent(out),
dimension(:) :: esat
1945 integer,
intent(out) :: nbad
1950 do i = 1,
size(temp,1)
1956 del = tmp-
dtres*
real(ind)
1964 real,
intent(in) :: temp
1965 real,
intent(out) :: desat
1966 integer,
intent(out) :: nbad
1976 del = tmp-
dtres*
real(ind)
1983 real,
intent(in) :: temp
1984 real,
intent(out) :: esat
1985 integer,
intent(out) :: nbad
1995 del = tmp-
dtres*
real(ind)
subroutine lookup_es3_k_2d(temp, esat, nbad)
real function, dimension(size(tem, 1)) compute_es_liq_k(tem, TFREEZE)
logical module_is_initialized
subroutine compute_qs_k_3d(temp, press, eps, zvir, qs, nbad, q, hc, dqsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine compute_mrs_k_2d(temp, press, eps, zvir, mrs, nbad, mr, hc, dmrsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine lookup_des2_k_1d(temp, desat, nbad)
subroutine lookup_es_des_k_3d(temp, esat, desat, nbad)
subroutine lookup_es3_k_3d(temp, esat, nbad)
subroutine compute_qs_k_0d(temp, press, eps, zvir, qs, nbad, q, hc, dqsdT, esat, es_over_liq, es_over_liq_and_ice)
real, dimension(:), allocatable d2table3
subroutine lookup_des2_k_3d(temp, desat, nbad)
subroutine lookup_es2_k_1d(temp, esat, nbad)
subroutine lookup_es_des_k_1d(temp, esat, desat, nbad)
subroutine lookup_es2_k_2d(temp, esat, nbad)
subroutine lookup_des_k_3d(temp, desat, nbad)
real, dimension(:), allocatable table
subroutine lookup_es_k_1d(temp, esat, nbad)
subroutine lookup_es_k_2d(temp, esat, nbad)
subroutine compute_mrs_k_1d(temp, press, eps, zvir, mrs, nbad, mr, hc, dmrsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine, public sat_vapor_pres_init_k(table_size, tcmin, tcmax, TFREEZE, HLV, RVGAS, ES0, err_msg, use_exact_qs_input, do_simple, construct_table_wrt_liq, construct_table_wrt_liq_and_ice, teps, tmin, dtinv)
subroutine lookup_es2_des2_k_0d(temp, esat, desat, nbad)
subroutine compute_mrs_k_3d(temp, press, eps, zvir, mrs, nbad, mr, hc, dmrsdT, esat, es_over_liq, es_over_liq_and_ice)
real, dimension(:), allocatable d2table
subroutine lookup_es2_k_0d(temp, esat, nbad)
subroutine lookup_es3_k_0d(temp, esat, nbad)
subroutine lookup_es2_des2_k_3d(temp, esat, desat, nbad)
real function, dimension(size(tem, 1)) compute_es_liq_ice_k(tem, TFREEZE)
subroutine lookup_es2_des2_k_2d(temp, esat, desat, nbad)
subroutine lookup_des2_k_2d(temp, desat, nbad)
subroutine lookup_des3_k_2d(temp, desat, nbad)
subroutine lookup_es3_des3_k_3d(temp, esat, desat, nbad)
subroutine lookup_es3_des3_k_1d(temp, esat, desat, nbad)
real, dimension(:), allocatable table2
subroutine lookup_es_des_k_2d(temp, esat, desat, nbad)
subroutine lookup_es2_des2_k_1d(temp, esat, desat, nbad)
subroutine lookup_des3_k_0d(temp, desat, nbad)
subroutine lookup_des_k_1d(temp, desat, nbad)
subroutine lookup_des_k_2d(temp, desat, nbad)
real, dimension(:), allocatable d2table2
subroutine lookup_es_k_0d(temp, esat, nbad)
real, dimension(:), allocatable dtable2
subroutine lookup_es2_k_3d(temp, esat, nbad)
subroutine lookup_es_k_3d(temp, esat, nbad)
real, dimension(:), allocatable table3
subroutine lookup_des_k_0d(temp, desat, nbad)
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)
real function, dimension(size(tem, 1)) compute_es_k(tem, TFREEZE)
subroutine lookup_es3_des3_k_0d(temp, esat, desat, nbad)
real, dimension(:), allocatable dtable3
subroutine lookup_es3_des3_k_2d(temp, esat, desat, nbad)
subroutine compute_qs_k_1d(temp, press, eps, zvir, qs, nbad, q, hc, dqsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine lookup_es_des_k_0d(temp, esat, desat, nbad)
subroutine lookup_des3_k_1d(temp, desat, nbad)
subroutine lookup_des2_k_0d(temp, desat, nbad)
subroutine compute_qs_k_2d(temp, press, eps, zvir, qs, nbad, q, hc, dqsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine compute_mrs_k_0d(temp, press, eps, zvir, mrs, nbad, mr, hc, dmrsdT, esat, es_over_liq, es_over_liq_and_ice)
subroutine lookup_des3_k_3d(temp, desat, nbad)
real, dimension(:), allocatable dtable
subroutine lookup_es3_k_1d(temp, esat, nbad)