[781] | 1 | ! |
---|
| 2 | MODULE ocean_slab_mod |
---|
| 3 | ! |
---|
| 4 | ! This module is used for both surface ocean and sea-ice when using the slab ocean, |
---|
| 5 | ! "ocean=slab". |
---|
| 6 | ! |
---|
| 7 | IMPLICIT NONE |
---|
[996] | 8 | PRIVATE |
---|
| 9 | PUBLIC :: ocean_slab_frac, ocean_slab_noice |
---|
[781] | 10 | |
---|
| 11 | CONTAINS |
---|
| 12 | ! |
---|
| 13 | !**************************************************************************************** |
---|
| 14 | ! |
---|
[996] | 15 | SUBROUTINE ocean_slab_frac(itime, dtime, jour, pctsrf, is_modified) |
---|
[781] | 16 | |
---|
[1067] | 17 | USE dimphy |
---|
[996] | 18 | USE limit_read_mod |
---|
[1067] | 19 | USE surface_data |
---|
[793] | 20 | INCLUDE "indicesol.h" |
---|
[996] | 21 | ! INCLUDE "clesphys.h" |
---|
[781] | 22 | |
---|
[996] | 23 | ! Arguments |
---|
[781] | 24 | !**************************************************************************************** |
---|
[996] | 25 | INTEGER, INTENT(IN) :: itime ! numero du pas de temps courant |
---|
| 26 | INTEGER, INTENT(IN) :: jour ! jour a lire dans l'annee |
---|
| 27 | REAL , INTENT(IN) :: dtime ! pas de temps de la physique (en s) |
---|
| 28 | REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: pctsrf ! sub-surface fraction |
---|
| 29 | LOGICAL, INTENT(OUT) :: is_modified ! true if pctsrf is modified at this time step |
---|
[781] | 30 | |
---|
| 31 | ! Local variables |
---|
| 32 | !**************************************************************************************** |
---|
| 33 | CHARACTER (len = 80) :: abort_message |
---|
[996] | 34 | CHARACTER (len = 20) :: modname = 'ocean_slab_frac' |
---|
[781] | 35 | |
---|
| 36 | |
---|
[1067] | 37 | IF (version_ocean == 'sicOBS') THEN |
---|
[996] | 38 | CALL limit_read_frac(itime, dtime, jour, pctsrf, is_modified) |
---|
| 39 | ELSE |
---|
| 40 | abort_message='Ocean slab model without forced sea-ice fractions has to be rewritten!!!' |
---|
[781] | 41 | CALL abort_gcm(modname,abort_message,1) |
---|
[996] | 42 | ! Here should sea-ice/ocean fraction either be calculated or returned if saved as a module varaiable |
---|
| 43 | ! (in the case the new fractions are calculated in ocean_slab_ice or ocean_slab_noice subroutines). |
---|
| 44 | END IF |
---|
[781] | 45 | |
---|
[996] | 46 | END SUBROUTINE ocean_slab_frac |
---|
[781] | 47 | ! |
---|
| 48 | !**************************************************************************************** |
---|
| 49 | ! |
---|
| 50 | SUBROUTINE ocean_slab_noice( & |
---|
[996] | 51 | itime, dtime, jour, knon, knindex, & |
---|
[1067] | 52 | p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, & |
---|
| 53 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
| 54 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
| 55 | ps, u1, v1, tsurf_in, & |
---|
[888] | 56 | radsol, snow, agesno, & |
---|
[1067] | 57 | qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, & |
---|
[996] | 58 | tsurf_new, dflux_s, dflux_l, lmt_bils) |
---|
[1067] | 59 | |
---|
| 60 | USE dimphy |
---|
| 61 | USE calcul_fluxs_mod |
---|
| 62 | |
---|
[793] | 63 | INCLUDE "indicesol.h" |
---|
[781] | 64 | INCLUDE "iniprint.h" |
---|
| 65 | |
---|
| 66 | ! Input arguments |
---|
| 67 | !**************************************************************************************** |
---|
[996] | 68 | INTEGER, INTENT(IN) :: itime |
---|
| 69 | INTEGER, INTENT(IN) :: jour |
---|
[781] | 70 | INTEGER, INTENT(IN) :: knon |
---|
| 71 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
| 72 | REAL, INTENT(IN) :: dtime |
---|
| 73 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
[1067] | 74 | REAL, DIMENSION(klon), INTENT(IN) :: cdragh, cdragm |
---|
[781] | 75 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
| 76 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
[1067] | 77 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefH, AcoefQ, BcoefH, BcoefQ |
---|
| 78 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefU, AcoefV, BcoefU, BcoefV |
---|
[781] | 79 | REAL, DIMENSION(klon), INTENT(IN) :: ps |
---|
[1067] | 80 | REAL, DIMENSION(klon), INTENT(IN) :: u1, v1 |
---|
[996] | 81 | REAL, DIMENSION(klon), INTENT(IN) :: tsurf_in |
---|
[781] | 82 | |
---|
| 83 | ! In/Output arguments |
---|
| 84 | !**************************************************************************************** |
---|
| 85 | REAL, DIMENSION(klon), INTENT(INOUT) :: radsol |
---|
| 86 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow |
---|
| 87 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno |
---|
| 88 | |
---|
| 89 | ! Output arguments |
---|
| 90 | !**************************************************************************************** |
---|
| 91 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
| 92 | REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat |
---|
[1067] | 93 | REAL, DIMENSION(klon), INTENT(OUT) :: flux_u1, flux_v1 |
---|
[781] | 94 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new |
---|
| 95 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
[996] | 96 | REAL, DIMENSION(klon), INTENT(OUT) :: lmt_bils |
---|
[781] | 97 | |
---|
| 98 | ! Local variables |
---|
| 99 | !**************************************************************************************** |
---|
[996] | 100 | INTEGER :: i |
---|
| 101 | REAL, DIMENSION(klon) :: cal, beta, dif_grnd |
---|
| 102 | REAL, DIMENSION(klon) :: lmt_bils_oce, lmt_foce, diff_sst |
---|
[1067] | 103 | REAL, DIMENSION(klon) :: u0, v0 |
---|
| 104 | REAL, DIMENSION(klon) :: u1_lay, v1_lay |
---|
[996] | 105 | REAL :: calc_bils_oce, deltat |
---|
| 106 | REAL, PARAMETER :: cyang=50.0 * 4.228e+06 ! capacite calorifique volumetrique de l'eau J/(m2 K) |
---|
[781] | 107 | |
---|
| 108 | !**************************************************************************************** |
---|
[996] | 109 | ! 1) Flux calculation |
---|
| 110 | ! |
---|
| 111 | !**************************************************************************************** |
---|
| 112 | cal(:) = 0. |
---|
| 113 | beta(:) = 1. |
---|
| 114 | dif_grnd(:) = 0. |
---|
| 115 | agesno(:) = 0. |
---|
[781] | 116 | |
---|
[1067] | 117 | ! Suppose zero surface speed |
---|
| 118 | u0(:)=0.0 |
---|
| 119 | v0(:)=0.0 |
---|
| 120 | u1_lay(:) = u1(:) - u0(:) |
---|
| 121 | v1_lay(:) = v1(:) - v0(:) |
---|
| 122 | |
---|
[781] | 123 | CALL calcul_fluxs(knon, is_oce, dtime, & |
---|
[1067] | 124 | tsurf_in, p1lay, cal, beta, cdragh, ps, & |
---|
[781] | 125 | precip_rain, precip_snow, snow, qsurf, & |
---|
| 126 | radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
---|
[1067] | 127 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
[781] | 128 | tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
---|
| 129 | |
---|
[1067] | 130 | ! - Flux calculation at first modele level for U and V |
---|
| 131 | CALL calcul_flux_wind(knon, dtime, & |
---|
| 132 | u0, v0, u1, v1, cdragm, & |
---|
| 133 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
| 134 | p1lay, temp_air, & |
---|
| 135 | flux_u1, flux_v1) |
---|
| 136 | |
---|
[781] | 137 | !**************************************************************************************** |
---|
[996] | 138 | ! 2) Get global variables lmt_bils and lmt_foce from file limit_slab.nc |
---|
[781] | 139 | ! |
---|
| 140 | !**************************************************************************************** |
---|
[996] | 141 | CALL limit_slab(itime, dtime, jour, lmt_bils, lmt_foce, diff_sst) ! global pour un processus |
---|
[781] | 142 | |
---|
[996] | 143 | lmt_bils_oce(:) = 0. |
---|
| 144 | WHERE (lmt_foce > 0.) |
---|
| 145 | lmt_bils_oce = lmt_bils / lmt_foce ! global |
---|
| 146 | END WHERE |
---|
[781] | 147 | |
---|
| 148 | !**************************************************************************************** |
---|
[996] | 149 | ! 3) Recalculate new temperature |
---|
[781] | 150 | ! |
---|
| 151 | !**************************************************************************************** |
---|
| 152 | DO i = 1, knon |
---|
[996] | 153 | calc_bils_oce = radsol(i) + fluxsens(i) + fluxlat(i) |
---|
| 154 | deltat = (calc_bils_oce - lmt_bils_oce(knindex(i)))*dtime/cyang +diff_sst(knindex(i)) |
---|
| 155 | tsurf_new(i) = tsurf_in(i) + deltat |
---|
| 156 | END DO |
---|
[781] | 157 | |
---|
[996] | 158 | END SUBROUTINE ocean_slab_noice |
---|
[781] | 159 | ! |
---|
| 160 | !**************************************************************************************** |
---|
| 161 | ! |
---|
| 162 | END MODULE ocean_slab_mod |
---|