Changeset 1669 for LMDZ5/branches/testing
- Timestamp:
- Oct 16, 2012, 2:41:50 PM (12 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 51 edited
- 248 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 1629-1633,1635,1637-1659,1666-1668
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/DefLists/cosp_input_nl.txt
r1664 r1669 27 27 &COSP_INPUT 28 28 CMOR_NL='./cmor/cosp_cmor_nl.txt', ! CMOR namelist 29 NPOINTS=9026,! Number of gridpoints (klon dans LMDZi : ici correspond a klon de 96x95)29 ! NPOINTS=9026,! Number of gridpoints (klon dans LMDZi : ici correspond a klon de 96x95) 30 30 NPOINTS_IT=10000,! Max number of gridpoints to be processed in one iteration 31 31 NCOLUMNS=20, ! Number of subcolumns … … 73 73 ! IR only algortihm (i.e. you can compare to nighttime 74 74 ! ISCCP data with this option) 75 ISCCP_TOPHEIGHT_DIRECTION= 1, ! direction for finding atmosphere pressure level75 ISCCP_TOPHEIGHT_DIRECTION=2, ! direction for finding atmosphere pressure level 76 76 ! with interpolated temperature equal to the radiance 77 77 ! determined cloud-top temperature -
LMDZ5/branches/testing/arch/arch-AMD64_CICLAD.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/SX/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/SX/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib -
LMDZ5/branches/testing/arch/arch-ES_MOON.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/ES/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/ES/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib 11 11 LIBPREFIX=sx -
LMDZ5/branches/testing/arch/arch-IA64_PLATINE.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/IA64/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/IA64/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib 11 11 -
LMDZ5/branches/testing/arch/arch-PW6_VARGAS.path
r1553 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/AIX6/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/AIX6/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib -
LMDZ5/branches/testing/arch/arch-SX8_BRODIE.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/SX/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/SX/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib -
LMDZ5/branches/testing/arch/arch-SX8_MERCURE.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/SX/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/SX/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib -
LMDZ5/branches/testing/arch/arch-SX9_MERCURE.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/SX/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/SX/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib -
LMDZ5/branches/testing/arch/arch-X64_CURIE.path
r1665 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib 11 11 -
LMDZ5/branches/testing/arch/arch-X64_TITANE.path
r1551 r1669 7 7 OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.$couple 8 8 OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib 9 INCA_LIBDIR=$LMDGCM/../INCA 3/config/lib10 INCA_INCDIR=$LMDGCM/../INCA 3/config/lib9 INCA_LIBDIR=$LMDGCM/../INCA/config/lib 10 INCA_INCDIR=$LMDGCM/../INCA/config/lib 11 11 -
LMDZ5/branches/testing/libf/bibio/netcdf95.F90
r1279 r1669 3 3 4 4 ! Author: Lionel GUEZ 5 6 ! Three criticisms may be made about the Fortran 90 NetCDF interface: 7 8 ! -- NetCDF procedures are usually functions with side effects. 9 ! First, they have "intent(out)" arguments. 10 ! Furthermore, there is obviously data transfer inside the procedures. 11 ! Any data transfer inside a function is considered as a side effect. 12 13 ! -- The caller of a NetCDF procedure usually has to handle the error 14 ! status. NetCDF procedures would be much friendlier if they behaved 15 ! like the Fortran input/output statements. That is, the error status 16 ! should be an optional output argument. 17 ! If the caller does not request the error status and there is an 18 ! error then the NetCDF procedure should produce an error message 19 ! and stop the program. 20 21 ! -- Some procedures use array arguments with assumed size. 22 ! It would be better to use the pointer attribute. 23 24 ! This module produces a NetCDF interface that answers those three 25 ! criticisms for some (not all) procedures. 26 27 ! "nf95_get_att" is more secure than "nf90_get_att" because it 28 ! checks that the "values" argument is long enough and removes the 29 ! null terminator, if any. 30 31 ! This module replaces some of the official NetCDF procedures. 32 ! This module also provides the procedures "handle_err" and "nf95_gw_var". 33 34 ! This module provides only a partial replacement for some generic 35 ! procedures such as "nf90_def_var". 5 ! See: 6 ! http://www.lmd.jussieu.fr/~lglmd/NetCDF95 36 7 37 8 use nf95_def_var_m 38 9 use nf95_put_var_m 10 use nf95_get_var_m 39 11 use nf95_gw_var_m 40 12 use nf95_put_att_m -
LMDZ5/branches/testing/libf/bibio/nf95_get_att_m.F90
r1279 r1669 1 1 ! $Id$ 2 2 module nf95_get_att_m 3 4 use handle_err_m, only: handle_err 5 use netcdf, only: nf90_get_att, nf90_noerr 6 use simple, only: nf95_inquire_attribute 3 7 4 8 implicit none 5 9 6 10 interface nf95_get_att 7 module procedure nf95_get_att_text 11 module procedure nf95_get_att_text, nf95_get_att_one_FourByteInt 12 13 ! The difference between the specific procedures is the type of 14 ! argument "values". 8 15 end interface 9 16 … … 15 22 subroutine nf95_get_att_text(ncid, varid, name, values, ncerr) 16 23 17 use netcdf, only: nf90_get_att, nf90_inquire_attribute, nf90_noerr18 use handle_err_m, only: handle_err19 20 24 integer, intent( in) :: ncid, varid 21 25 character(len = *), intent( in) :: name … … 23 27 integer, intent(out), optional:: ncerr 24 28 25 ! Variable local to the procedure:29 ! Variables local to the procedure: 26 30 integer ncerr_not_opt 27 31 integer att_len … … 30 34 31 35 ! Check that the length of "values" is large enough: 32 ncerr_not_opt = nf90_inquire_attribute(ncid, varid, name, len=att_len) 33 call handle_err("nf95_get_att_text nf90_inquire_attribute " & 34 // trim(name), ncerr_not_opt, ncid, varid) 35 if (len(values) < att_len) then 36 print *, "nf95_get_att_text" 37 print *, "varid = ", varid 38 print *, "attribute name: ", name 39 print *, 'length of "values" is not large enough' 40 print *, "len(values) = ", len(values) 41 print *, "number of characters in attribute: ", att_len 42 stop 1 36 call nf95_inquire_attribute(ncid, varid, name, nclen=att_len, & 37 ncerr=ncerr_not_opt) 38 if (ncerr_not_opt == nf90_noerr) then 39 if (len(values) < att_len) then 40 print *, "nf95_get_att_text" 41 print *, "varid = ", varid 42 print *, "attribute name: ", name 43 print *, 'length of "values" is not large enough' 44 print *, "len(values) = ", len(values) 45 print *, "number of characters in attribute: ", att_len 46 stop 1 47 end if 43 48 end if 44 49 … … 48 53 ncerr = ncerr_not_opt 49 54 else 50 call handle_err("nf95_get_att_text", ncerr_not_opt, ncid, varid) 55 call handle_err("nf95_get_att_text " // trim(name), ncerr_not_opt, & 56 ncid, varid) 51 57 end if 52 58 … … 58 64 end subroutine nf95_get_att_text 59 65 66 !*********************** 67 68 subroutine nf95_get_att_one_FourByteInt(ncid, varid, name, values, ncerr) 69 70 integer, intent( in) :: ncid, varid 71 character(len = *), intent( in) :: name 72 integer , intent(out) :: values 73 integer, intent(out), optional:: ncerr 74 75 ! Variables local to the procedure: 76 integer ncerr_not_opt 77 integer att_len 78 79 !------------------- 80 81 ! Check that the attribute contains a single value: 82 call nf95_inquire_attribute(ncid, varid, name, nclen=att_len, & 83 ncerr=ncerr_not_opt) 84 if (ncerr_not_opt == nf90_noerr) then 85 if (att_len /= 1) then 86 print *, "nf95_get_att_one_FourByteInt" 87 print *, "varid = ", varid 88 print *, "attribute name: ", name 89 print *, 'the attribute does not contain a single value' 90 print *, "number of values in attribute: ", att_len 91 stop 1 92 end if 93 end if 94 95 ncerr_not_opt = nf90_get_att(ncid, varid, name, values) 96 if (present(ncerr)) then 97 ncerr = ncerr_not_opt 98 else 99 call handle_err("nf95_get_att_one_FourByteInt " // trim(name), & 100 ncerr_not_opt, ncid, varid) 101 end if 102 103 end subroutine nf95_get_att_one_FourByteInt 104 60 105 end module nf95_get_att_m -
LMDZ5/branches/testing/libf/bibio/nf95_gw_var_m.F90
r1279 r1669 1 1 ! $Id$ 2 2 module nf95_gw_var_m 3 4 use nf95_get_var_m, only: NF95_GET_VAR 5 use simple, only: nf95_inquire_variable, nf95_inquire_dimension 3 6 4 7 implicit none … … 8 11 ! These procedures read a whole NetCDF variable (coordinate or 9 12 ! primary) into an array. 10 ! The difference between the procedures is the rank of the array11 ! a nd the type of Fortran values.13 ! The difference between the procedures is the rank and type of 14 ! argument "values". 12 15 ! The procedures do not check the type of the NetCDF variable. 13 16 14 !!$ module procedure nf95_gw_var_real_1d, nf95_gw_var_real_2d, & 15 !!$ nf95_gw_var_real_3d, nf95_gw_var_real_4d, nf95_gw_var_dble_1d, & 16 !!$ nf95_gw_var_dble_3d, nf95_gw_var_int_1d, nf95_gw_var_int_3d 17 ! Not including double precision procedures in the generic 18 ! interface because we use a compilation option that changes default 19 ! real precision. 17 20 module procedure nf95_gw_var_real_1d, nf95_gw_var_real_2d, & 18 nf95_gw_var_real_3d, nf95_gw_var_real_4d, nf95_gw_var_ int_1d, &19 nf95_gw_var_int_ 3d21 nf95_gw_var_real_3d, nf95_gw_var_real_4d, nf95_gw_var_real_5d, & 22 nf95_gw_var_int_1d, nf95_gw_var_int_3d 20 23 end interface 21 24 … … 29 32 ! Real type, the array has rank 1. 30 33 31 use netcdf, only: NF90_GET_VAR32 use simple, only: nf95_inquire_variable, nf95_inquire_dimension33 use handle_err_m, only: handle_err34 35 34 integer, intent(in):: ncid 36 35 integer, intent(in):: varid … … 38 37 39 38 ! Variables local to the procedure: 40 integer ierr,len41 integer, pointer 39 integer nclen 40 integer, pointer:: dimids(:) 42 41 43 42 !--------------------- … … 46 45 47 46 if (size(dimids) /= 1) then 48 print *, "nf95_gw_var_real_1d: NetCDF variable is not of rank 1" 49 stop 1 50 end if 51 52 call nf95_inquire_dimension(ncid, dimids(1), len=len) 53 deallocate(dimids) ! pointer 54 55 allocate(values(len)) 56 if (len /= 0) then 57 ierr = NF90_GET_VAR(ncid, varid, values) 58 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 59 end if 47 print *, "nf95_gw_var_real_1d:" 48 print *, "varid = ", varid 49 print *, "rank of NetCDF variable is ", size(dimids), ", not 1" 50 stop 1 51 end if 52 53 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen) 54 deallocate(dimids) ! pointer 55 56 allocate(values(nclen)) 57 if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values) 60 58 61 59 end subroutine nf95_gw_var_real_1d … … 67 65 ! Real type, the array has rank 2. 68 66 69 use netcdf, only: NF90_GET_VAR70 use simple, only: nf95_inquire_variable, nf95_inquire_dimension71 use handle_err_m, only: handle_err72 73 67 integer, intent(in):: ncid 74 68 integer, intent(in):: varid … … 76 70 77 71 ! Variables local to the procedure: 78 integer ierr, len1,len279 integer, pointer 72 integer nclen1, nclen2 73 integer, pointer:: dimids(:) 80 74 81 75 !--------------------- … … 84 78 85 79 if (size(dimids) /= 2) then 86 print *, "nf95_gw_var_real_2d: NetCDF variable is not of rank 2" 87 stop 1 88 end if 89 90 call nf95_inquire_dimension(ncid, dimids(1), len=len1) 91 call nf95_inquire_dimension(ncid, dimids(2), len=len2) 92 deallocate(dimids) ! pointer 93 94 allocate(values(len1, len2)) 95 if (len1 /= 0 .and. len2 /= 0) then 96 ierr = NF90_GET_VAR(ncid, varid, values) 97 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 98 end if 80 print *, "nf95_gw_var_real_2d:" 81 print *, "varid = ", varid 82 print *, "rank of NetCDF variable is ", size(dimids), ", not 2" 83 stop 1 84 end if 85 86 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1) 87 call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2) 88 deallocate(dimids) ! pointer 89 90 allocate(values(nclen1, nclen2)) 91 if (nclen1 /= 0 .and. nclen2 /= 0) call NF95_GET_VAR(ncid, varid, values) 99 92 100 93 end subroutine nf95_gw_var_real_2d … … 106 99 ! Real type, the array has rank 3. 107 100 108 use netcdf, only: NF90_GET_VAR109 use simple, only: nf95_inquire_variable, nf95_inquire_dimension110 use handle_err_m, only: handle_err111 112 101 integer, intent(in):: ncid 113 102 integer, intent(in):: varid … … 115 104 116 105 ! Variables local to the procedure: 117 integer ierr, len1, len2,len3118 integer, pointer 106 integer nclen1, nclen2, nclen3 107 integer, pointer:: dimids(:) 119 108 120 109 !--------------------- … … 123 112 124 113 if (size(dimids) /= 3) then 125 print *, "nf95_gw_var_real_3d: NetCDF variable is not of rank 3" 126 stop 1 127 end if 128 129 call nf95_inquire_dimension(ncid, dimids(1), len=len1) 130 call nf95_inquire_dimension(ncid, dimids(2), len=len2) 131 call nf95_inquire_dimension(ncid, dimids(3), len=len3) 132 deallocate(dimids) ! pointer 133 134 allocate(values(len1, len2, len3)) 135 if (len1 * len2 * len3 /= 0) then 136 ierr = NF90_GET_VAR(ncid, varid, values) 137 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 138 end if 114 print *, "nf95_gw_var_real_3d:" 115 print *, "varid = ", varid 116 print *, "rank of NetCDF variable is ", size(dimids), ", not 3" 117 stop 1 118 end if 119 120 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1) 121 call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2) 122 call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3) 123 deallocate(dimids) ! pointer 124 125 allocate(values(nclen1, nclen2, nclen3)) 126 if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values) 139 127 140 128 end subroutine nf95_gw_var_real_3d … … 146 134 ! Real type, the array has rank 4. 147 135 148 use netcdf, only: NF90_GET_VAR149 use simple, only: nf95_inquire_variable, nf95_inquire_dimension150 use handle_err_m, only: handle_err151 152 136 integer, intent(in):: ncid 153 137 integer, intent(in):: varid … … 155 139 156 140 ! Variables local to the procedure: 157 integer ierr,len_dim(4), i158 integer, pointer 141 integer len_dim(4), i 142 integer, pointer:: dimids(:) 159 143 160 144 !--------------------- … … 163 147 164 148 if (size(dimids) /= 4) then 165 print *, "nf95_gw_var_real_4d: NetCDF variable is not of rank 4" 149 print *, "nf95_gw_var_real_4d:" 150 print *, "varid = ", varid 151 print *, "rank of NetCDF variable is ", size(dimids), ", not 4" 166 152 stop 1 167 153 end if 168 154 169 155 do i = 1, 4 170 call nf95_inquire_dimension(ncid, dimids(i), len=len_dim(i))156 call nf95_inquire_dimension(ncid, dimids(i), nclen=len_dim(i)) 171 157 end do 172 158 deallocate(dimids) ! pointer 173 159 174 160 allocate(values(len_dim(1), len_dim(2), len_dim(3), len_dim(4))) 175 if (all(len_dim /= 0)) then 176 ierr = NF90_GET_VAR(ncid, varid, values) 177 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 178 end if 161 if (all(len_dim /= 0)) call NF95_GET_VAR(ncid, varid, values) 179 162 180 163 end subroutine nf95_gw_var_real_4d … … 182 165 !************************************ 183 166 167 subroutine nf95_gw_var_real_5d(ncid, varid, values) 168 169 ! Real type, the array has rank 5. 170 171 integer, intent(in):: ncid 172 integer, intent(in):: varid 173 real, pointer:: values(:, :, :, :, :) 174 175 ! Variables local to the procedure: 176 integer len_dim(5), i 177 integer, pointer:: dimids(:) 178 179 !--------------------- 180 181 call nf95_inquire_variable(ncid, varid, dimids=dimids) 182 183 if (size(dimids) /= 5) then 184 print *, "nf95_gw_var_real_5d:" 185 print *, "varid = ", varid 186 print *, "rank of NetCDF variable is ", size(dimids), ", not 5" 187 stop 1 188 end if 189 190 do i = 1, 5 191 call nf95_inquire_dimension(ncid, dimids(i), nclen=len_dim(i)) 192 end do 193 deallocate(dimids) ! pointer 194 195 allocate(values(len_dim(1), len_dim(2), len_dim(3), len_dim(4), len_dim(5))) 196 if (all(len_dim /= 0)) call NF95_GET_VAR(ncid, varid, values) 197 198 end subroutine nf95_gw_var_real_5d 199 200 !************************************ 201 184 202 !!$ subroutine nf95_gw_var_dble_1d(ncid, varid, values) 185 203 !!$ 186 204 !!$ ! Double precision, the array has rank 1. 187 !!$188 !!$ use netcdf, only: NF90_GET_VAR189 !!$ use simple, only: nf95_inquire_variable, nf95_inquire_dimension190 !!$ use handle_err_m, only: handle_err191 205 !!$ 192 206 !!$ integer, intent(in):: ncid … … 195 209 !!$ 196 210 !!$ ! Variables local to the procedure: 197 !!$ integer ierr,len198 !!$ integer, pointer 211 !!$ integer nclen 212 !!$ integer, pointer:: dimids(:) 199 213 !!$ 200 214 !!$ !--------------------- … … 203 217 !!$ 204 218 !!$ if (size(dimids) /= 1) then 205 !!$ print *, "nf95_gw_var_dble_1d: NetCDF variable is not of rank 1" 206 !!$ stop 1 219 !!$ print *, "nf95_gw_var_dble_1d:" 220 !!$ print *, "varid = ", varid 221 !!$ print *, "rank of NetCDF variable is ", size(dimids), ", not 1" 222 !!$ stop 1 207 223 !!$ end if 208 224 !!$ 209 !!$ call nf95_inquire_dimension(ncid, dimids(1), len=len)225 !!$ call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen) 210 226 !!$ deallocate(dimids) ! pointer 211 227 !!$ 212 !!$ allocate(values(len)) 213 !!$ if (len /= 0) then 214 !!$ ierr = NF90_GET_VAR(ncid, varid, values) 215 !!$ call handle_err("NF90_GET_VAR", ierr, ncid, varid) 216 !!$ end if 228 !!$ allocate(values(nclen)) 229 !!$ if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values) 217 230 !!$ 218 231 !!$ end subroutine nf95_gw_var_dble_1d … … 223 236 !!$ 224 237 !!$ ! Double precision, the array has rank 3. 225 !!$226 !!$ use netcdf, only: NF90_GET_VAR227 !!$ use simple, only: nf95_inquire_variable, nf95_inquire_dimension228 !!$ use handle_err_m, only: handle_err229 238 !!$ 230 239 !!$ integer, intent(in):: ncid … … 233 242 !!$ 234 243 !!$ ! Variables local to the procedure: 235 !!$ integer ierr, len1, len2,len3236 !!$ integer, pointer 244 !!$ integer nclen1, nclen2, nclen3 245 !!$ integer, pointer:: dimids(:) 237 246 !!$ 238 247 !!$ !--------------------- … … 241 250 !!$ 242 251 !!$ if (size(dimids) /= 3) then 243 !!$ print *, "nf95_gw_var_dble_3d: NetCDF variable is not of rank 3" 252 !!$ print *, "nf95_gw_var_dble_3d:" 253 !!$ print *, "varid = ", varid 254 !!$ print *, "rank of NetCDF variable is ", size(dimids), ", not 3" 244 255 !!$ stop 1 245 256 !!$ end if 246 257 !!$ 247 !!$ call nf95_inquire_dimension(ncid, dimids(1), len=len1)248 !!$ call nf95_inquire_dimension(ncid, dimids(2), len=len2)249 !!$ call nf95_inquire_dimension(ncid, dimids(3), len=len3)258 !!$ call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1) 259 !!$ call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2) 260 !!$ call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3) 250 261 !!$ deallocate(dimids) ! pointer 251 262 !!$ 252 !!$ allocate(values(len1, len2, len3)) 253 !!$ if (len1 * len2 * len3 /= 0) then 254 !!$ ierr = NF90_GET_VAR(ncid, varid, values) 255 !!$ call handle_err("NF90_GET_VAR", ierr, ncid, varid) 256 !!$ end if 263 !!$ allocate(values(nclen1, nclen2, nclen3)) 264 !!$ if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values) 257 265 !!$ 258 266 !!$ end subroutine nf95_gw_var_dble_3d 259 267 !!$ 260 268 !************************************ 261 269 … … 264 272 ! Integer type, the array has rank 1. 265 273 266 use netcdf, only: NF90_GET_VAR267 use simple, only: nf95_inquire_variable, nf95_inquire_dimension268 use handle_err_m, only: handle_err269 270 274 integer, intent(in):: ncid 271 275 integer, intent(in):: varid … … 273 277 274 278 ! Variables local to the procedure: 275 integer ierr,len276 integer, pointer 279 integer nclen 280 integer, pointer:: dimids(:) 277 281 278 282 !--------------------- … … 281 285 282 286 if (size(dimids) /= 1) then 283 print *, "nf95_gw_var_int_1d: NetCDF variable is not of rank 1" 284 stop 1 285 end if 286 287 call nf95_inquire_dimension(ncid, dimids(1), len=len) 288 deallocate(dimids) ! pointer 289 290 allocate(values(len)) 291 if (len /= 0) then 292 ierr = NF90_GET_VAR(ncid, varid, values) 293 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 294 end if 287 print *, "nf95_gw_var_int_1d:" 288 print *, "varid = ", varid 289 print *, "rank of NetCDF variable is ", size(dimids), ", not 1" 290 stop 1 291 end if 292 293 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen) 294 deallocate(dimids) ! pointer 295 296 allocate(values(nclen)) 297 if (nclen /= 0) call NF95_GET_VAR(ncid, varid, values) 295 298 296 299 end subroutine nf95_gw_var_int_1d … … 302 305 ! Integer type, the array has rank 3. 303 306 304 use netcdf, only: NF90_GET_VAR305 use simple, only: nf95_inquire_variable, nf95_inquire_dimension306 use handle_err_m, only: handle_err307 308 307 integer, intent(in):: ncid 309 308 integer, intent(in):: varid … … 311 310 312 311 ! Variables local to the procedure: 313 integer ierr, len1, len2,len3314 integer, pointer 312 integer nclen1, nclen2, nclen3 313 integer, pointer:: dimids(:) 315 314 316 315 !--------------------- … … 319 318 320 319 if (size(dimids) /= 3) then 321 print *, "nf95_gw_var_int_3d: NetCDF variable is not of rank 3" 322 stop 1 323 end if 324 325 call nf95_inquire_dimension(ncid, dimids(1), len=len1) 326 call nf95_inquire_dimension(ncid, dimids(2), len=len2) 327 call nf95_inquire_dimension(ncid, dimids(3), len=len3) 328 deallocate(dimids) ! pointer 329 330 allocate(values(len1, len2, len3)) 331 if (len1 * len2 * len3 /= 0) then 332 ierr = NF90_GET_VAR(ncid, varid, values) 333 call handle_err("NF90_GET_VAR", ierr, ncid, varid) 334 end if 320 print *, "nf95_gw_var_int_3d:" 321 print *, "varid = ", varid 322 print *, "rank of NetCDF variable is ", size(dimids), ", not 3" 323 stop 1 324 end if 325 326 call nf95_inquire_dimension(ncid, dimids(1), nclen=nclen1) 327 call nf95_inquire_dimension(ncid, dimids(2), nclen=nclen2) 328 call nf95_inquire_dimension(ncid, dimids(3), nclen=nclen3) 329 deallocate(dimids) ! pointer 330 331 allocate(values(nclen1, nclen2, nclen3)) 332 if (nclen1 * nclen2 * nclen3 /= 0) call NF95_GET_VAR(ncid, varid, values) 335 333 336 334 end subroutine nf95_gw_var_int_3d -
LMDZ5/branches/testing/libf/bibio/nf95_put_var_m.F90
r1279 r1669 9 9 nf95_put_var_2D_FourByteReal, nf95_put_var_3D_FourByteReal, & 10 10 nf95_put_var_4D_FourByteReal 11 !!$ module procedure nf95_put_var_1D_FourByteReal, &12 !!$ nf95_put_var_2D_FourByteReal, nf95_put_var_3D_FourByteReal, &13 !!$ nf95_put_var_4D_FourByteReal, nf90_put_var_1D_EightByteReal, &14 !!$ nf90_put_var_3D_EightByteReal15 11 end interface 16 12 … … 25 21 use handle_err_m, only: handle_err 26 22 27 integer, intent( 28 real, intent( 29 integer, dimension(:), optional, intent( 23 integer, intent(in) :: ncid, varid 24 real, intent(in) :: values 25 integer, dimension(:), optional, intent(in) :: start 30 26 integer, intent(out), optional:: ncerr 31 27 … … 52 48 use handle_err_m, only: handle_err 53 49 54 integer, intent( 55 integer, intent( 56 integer, dimension(:), optional, intent( 50 integer, intent(in) :: ncid, varid 51 integer, intent(in) :: values 52 integer, dimension(:), optional, intent(in) :: start 57 53 integer, intent(out), optional:: ncerr 58 54 … … 74 70 !*********************** 75 71 76 subroutine nf95_put_var_1D_FourByteReal(ncid, varid, values, start, count,&77 stride, map, ncerr)72 subroutine nf95_put_var_1D_FourByteReal(ncid, varid, values, start, & 73 count_nc, stride, map, ncerr) 78 74 79 75 use netcdf, only: nf90_put_var … … 82 78 integer, intent(in) :: ncid, varid 83 79 real, intent(in) :: values(:) 84 integer, dimension(:), optional, intent(in) :: start, count , stride, map85 integer, intent(out), optional:: ncerr 86 87 ! Variable local to the procedure: 88 integer ncerr_not_opt 89 90 !------------------- 91 92 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count , stride, &93 map)80 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 81 integer, intent(out), optional:: ncerr 82 83 ! Variable local to the procedure: 84 integer ncerr_not_opt 85 86 !------------------- 87 88 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 89 stride, map) 94 90 if (present(ncerr)) then 95 91 ncerr = ncerr_not_opt … … 103 99 !*********************** 104 100 105 subroutine nf95_put_var_1D_FourByteInt(ncid, varid, values, start, count,&106 stride, map, ncerr)101 subroutine nf95_put_var_1D_FourByteInt(ncid, varid, values, start, & 102 count_nc, stride, map, ncerr) 107 103 108 104 use netcdf, only: nf90_put_var … … 111 107 integer, intent(in) :: ncid, varid 112 108 integer, intent(in) :: values(:) 113 integer, dimension(:), optional, intent(in) :: start, count , stride, map114 integer, intent(out), optional:: ncerr 115 116 ! Variable local to the procedure: 117 integer ncerr_not_opt 118 119 !------------------- 120 121 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count , stride, &122 map)109 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 110 integer, intent(out), optional:: ncerr 111 112 ! Variable local to the procedure: 113 integer ncerr_not_opt 114 115 !------------------- 116 117 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 118 stride, map) 123 119 if (present(ncerr)) then 124 120 ncerr = ncerr_not_opt … … 132 128 !*********************** 133 129 134 subroutine nf95_put_var_2D_FourByteReal(ncid, varid, values, start, count, & 135 stride, map, ncerr) 136 137 use netcdf, only: nf90_put_var 138 use handle_err_m, only: handle_err 139 140 integer, intent( in) :: ncid, varid 141 real, intent( in) :: values(:, :) 142 integer, dimension(:), optional, intent( in) :: start, count, stride, map 143 integer, intent(out), optional:: ncerr 144 145 ! Variable local to the procedure: 146 integer ncerr_not_opt 147 148 !------------------- 149 150 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, & 151 map) 130 subroutine nf95_put_var_1D_EightByteReal(ncid, varid, values, start, & 131 count_nc, stride, map, ncerr) 132 133 use typesizes, only: eightByteReal 134 use netcdf, only: nf90_put_var 135 use handle_err_m, only: handle_err 136 137 integer, intent(in) :: ncid, varid 138 real (kind = EightByteReal), intent(in) :: values(:) 139 integer, dimension(:), optional, intent(in):: start, count_nc, stride, map 140 integer, intent(out), optional:: ncerr 141 142 ! Variable local to the procedure: 143 integer ncerr_not_opt 144 145 !------------------- 146 147 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 148 stride, map) 149 if (present(ncerr)) then 150 ncerr = ncerr_not_opt 151 else 152 call handle_err("nf95_put_var_1D_eightByteReal", ncerr_not_opt, ncid, & 153 varid) 154 end if 155 156 end subroutine nf95_put_var_1D_EightByteReal 157 158 !*********************** 159 160 subroutine nf95_put_var_2D_FourByteReal(ncid, varid, values, start, & 161 count_nc, stride, map, ncerr) 162 163 use netcdf, only: nf90_put_var 164 use handle_err_m, only: handle_err 165 166 integer, intent(in) :: ncid, varid 167 real, intent(in) :: values(:, :) 168 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 169 integer, intent(out), optional:: ncerr 170 171 ! Variable local to the procedure: 172 integer ncerr_not_opt 173 174 !------------------- 175 176 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 177 stride, map) 152 178 if (present(ncerr)) then 153 179 ncerr = ncerr_not_opt … … 161 187 !*********************** 162 188 163 subroutine nf95_put_var_3D_FourByteReal(ncid, varid, values, start, count, & 164 stride, map, ncerr) 165 166 use netcdf, only: nf90_put_var 167 use handle_err_m, only: handle_err 168 169 integer, intent( in) :: ncid, varid 170 real, intent( in) :: values(:, :, :) 171 integer, dimension(:), optional, intent( in) :: start, count, stride, map 172 integer, intent(out), optional:: ncerr 173 174 ! Variable local to the procedure: 175 integer ncerr_not_opt 176 177 !------------------- 178 179 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, & 180 map) 189 subroutine nf95_put_var_2D_EightByteReal(ncid, varid, values, start, & 190 count_nc, stride, map, ncerr) 191 192 use typesizes, only: EightByteReal 193 use netcdf, only: nf90_put_var 194 use handle_err_m, only: handle_err 195 196 integer, intent(in) :: ncid, varid 197 real (kind = EightByteReal), intent(in) :: values(:, :) 198 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 199 integer, intent(out), optional:: ncerr 200 201 ! Variable local to the procedure: 202 integer ncerr_not_opt 203 204 !------------------- 205 206 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 207 stride, map) 208 if (present(ncerr)) then 209 ncerr = ncerr_not_opt 210 else 211 call handle_err("nf95_put_var_2D_EightByteReal", ncerr_not_opt, ncid, & 212 varid) 213 end if 214 215 end subroutine nf95_put_var_2D_EightByteReal 216 217 !*********************** 218 219 subroutine nf95_put_var_3D_FourByteReal(ncid, varid, values, start, & 220 count_nc, stride, map, ncerr) 221 222 use netcdf, only: nf90_put_var 223 use handle_err_m, only: handle_err 224 225 integer, intent(in) :: ncid, varid 226 real, intent(in) :: values(:, :, :) 227 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 228 integer, intent(out), optional:: ncerr 229 230 ! Variable local to the procedure: 231 integer ncerr_not_opt 232 233 !------------------- 234 235 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 236 stride, map) 181 237 if (present(ncerr)) then 182 238 ncerr = ncerr_not_opt … … 190 246 !*********************** 191 247 192 subroutine nf95_put_var_4D_FourByteReal(ncid, varid, values, start, count, & 193 stride, map, ncerr) 194 195 use netcdf, only: nf90_put_var 196 use handle_err_m, only: handle_err 197 198 integer, intent( in) :: ncid, varid 199 real, intent( in) :: values(:, :, :, :) 200 integer, dimension(:), optional, intent( in) :: start, count, stride, map 201 integer, intent(out), optional:: ncerr 202 203 ! Variable local to the procedure: 204 integer ncerr_not_opt 205 206 !------------------- 207 208 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, & 209 map) 248 subroutine nf95_put_var_3D_EightByteReal(ncid, varid, values, start, & 249 count_nc, stride, map, ncerr) 250 251 use typesizes, only: eightByteReal 252 use netcdf, only: nf90_put_var 253 use handle_err_m, only: handle_err 254 255 integer, intent(in) :: ncid, varid 256 real (kind = EightByteReal), intent(in) :: values(:, :, :) 257 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 258 integer, intent(out), optional:: ncerr 259 260 ! Variable local to the procedure: 261 integer ncerr_not_opt 262 263 !------------------- 264 265 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 266 stride, map) 267 if (present(ncerr)) then 268 ncerr = ncerr_not_opt 269 else 270 call handle_err("nf95_put_var_3D_eightByteReal", ncerr_not_opt, ncid, & 271 varid) 272 end if 273 274 end subroutine nf95_put_var_3D_EightByteReal 275 276 !*********************** 277 278 subroutine nf95_put_var_4D_FourByteReal(ncid, varid, values, start, & 279 count_nc, stride, map, ncerr) 280 281 use netcdf, only: nf90_put_var 282 use handle_err_m, only: handle_err 283 284 integer, intent(in) :: ncid, varid 285 real, intent(in) :: values(:, :, :, :) 286 integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map 287 integer, intent(out), optional:: ncerr 288 289 ! Variable local to the procedure: 290 integer ncerr_not_opt 291 292 !------------------- 293 294 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 295 stride, map) 210 296 if (present(ncerr)) then 211 297 ncerr = ncerr_not_opt … … 219 305 !*********************** 220 306 221 !!$ subroutine nf90_put_var_1D_EightByteReal(ncid, varid, values, start, count, & 222 !!$ stride, map, ncerr) 223 !!$ 224 !!$ use typesizes, only: eightByteReal 225 !!$ use netcdf, only: nf90_put_var 226 !!$ use handle_err_m, only: handle_err 227 !!$ 228 !!$ integer, intent( in) :: ncid, varid 229 !!$ real (kind = EightByteReal), intent( in) :: values(:) 230 !!$ integer, dimension(:), optional, intent( in) :: start, count, stride, map 231 !!$ integer, intent(out), optional:: ncerr 232 !!$ 233 !!$ ! Variable local to the procedure: 234 !!$ integer ncerr_not_opt 235 !!$ 236 !!$ !------------------- 237 !!$ 238 !!$ ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, & 239 !!$ map) 240 !!$ if (present(ncerr)) then 241 !!$ ncerr = ncerr_not_opt 242 !!$ else 243 !!$ call handle_err("nf95_put_var_1D_eightByteReal", ncerr_not_opt, ncid, & 244 !!$ varid) 245 !!$ end if 246 !!$ 247 !!$ end subroutine nf90_put_var_1D_EightByteReal 248 !!$ 249 !!$ !*********************** 250 !!$ 251 !!$ subroutine nf90_put_var_3D_EightByteReal(ncid, varid, values, start, count, & 252 !!$ stride, map, ncerr) 253 !!$ 254 !!$ use typesizes, only: eightByteReal 255 !!$ use netcdf, only: nf90_put_var 256 !!$ use handle_err_m, only: handle_err 257 !!$ 258 !!$ integer, intent( in) :: ncid, varid 259 !!$ real (kind = EightByteReal), intent( in) :: values(:, :, :) 260 !!$ integer, dimension(:), optional, intent( in) :: start, count, stride, map 261 !!$ integer, intent(out), optional:: ncerr 262 !!$ 263 !!$ ! Variable local to the procedure: 264 !!$ integer ncerr_not_opt 265 !!$ 266 !!$ !------------------- 267 !!$ 268 !!$ ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, & 269 !!$ map) 270 !!$ if (present(ncerr)) then 271 !!$ ncerr = ncerr_not_opt 272 !!$ else 273 !!$ call handle_err("nf95_put_var_3D_eightByteReal", ncerr_not_opt, ncid, & 274 !!$ varid) 275 !!$ end if 276 !!$ 277 !!$ end subroutine nf90_put_var_3D_EightByteReal 307 subroutine nf95_put_var_4D_EightByteReal(ncid, varid, values, start, & 308 count_nc, stride, map, ncerr) 309 310 use typesizes, only: EightByteReal 311 use netcdf, only: nf90_put_var 312 use handle_err_m, only: handle_err 313 314 integer, intent(in):: ncid, varid 315 real(kind = EightByteReal), intent(in):: values(:, :, :, :) 316 integer, dimension(:), optional, intent(in):: start, count_nc, stride, map 317 integer, intent(out), optional:: ncerr 318 319 ! Variable local to the procedure: 320 integer ncerr_not_opt 321 322 !------------------- 323 324 ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & 325 stride, map) 326 if (present(ncerr)) then 327 ncerr = ncerr_not_opt 328 else 329 call handle_err("nf95_put_var_4D_EightByteReal", ncerr_not_opt, ncid, & 330 varid) 331 end if 332 333 end subroutine nf95_put_var_4D_EightByteReal 278 334 279 335 end module nf95_put_var_m -
LMDZ5/branches/testing/libf/bibio/simple.F90
r1279 r1669 2 2 module simple 3 3 4 use handle_err_m, only: handle_err 5 4 6 implicit none 5 7 8 private handle_err 9 6 10 contains 7 11 … … 9 13 10 14 use netcdf, only: nf90_open 11 use handle_err_m, only: handle_err12 15 13 16 character(len=*), intent(in):: path … … 36 39 37 40 use netcdf, only: nf90_inq_dimid 38 use handle_err_m, only: handle_err 39 40 integer, intent( in) :: ncid 41 character (len = *), intent( in) :: name 41 42 integer, intent(in) :: ncid 43 character (len = *), intent(in) :: name 42 44 integer, intent(out) :: dimid 43 45 integer, intent(out), optional:: ncerr … … 52 54 ncerr = ncerr_not_opt 53 55 else 54 call handle_err("nf95_inq_dimid ", ncerr_not_opt, ncid)56 call handle_err("nf95_inq_dimid " // name, ncerr_not_opt, ncid) 55 57 end if 56 58 … … 59 61 !************************ 60 62 61 subroutine nf95_inquire_dimension(ncid, dimid, name, len, ncerr)63 subroutine nf95_inquire_dimension(ncid, dimid, name, nclen, ncerr) 62 64 63 65 use netcdf, only: nf90_inquire_dimension 64 use handle_err_m, only: handle_err65 66 66 67 integer, intent( in) :: ncid, dimid 67 68 character (len = *), optional, intent(out) :: name 68 integer, optional, intent(out) :: len69 integer, intent(out), optional:: ncerr 70 71 ! Variable local to the procedure: 72 integer ncerr_not_opt 73 74 !------------------- 75 76 ncerr_not_opt = nf90_inquire_dimension(ncid, dimid, name, len)69 integer, optional, intent(out) :: nclen 70 integer, intent(out), optional:: ncerr 71 72 ! Variable local to the procedure: 73 integer ncerr_not_opt 74 75 !------------------- 76 77 ncerr_not_opt = nf90_inquire_dimension(ncid, dimid, name, nclen) 77 78 if (present(ncerr)) then 78 79 ncerr = ncerr_not_opt … … 88 89 89 90 use netcdf, only: nf90_inq_varid 90 use handle_err_m, only: handle_err91 91 92 92 integer, intent(in) :: ncid 93 character (len = *), intent(in):: name93 character(len=*), intent(in):: name 94 94 integer, intent(out) :: varid 95 95 integer, intent(out), optional:: ncerr … … 115 115 116 116 ! In "nf90_inquire_variable", "dimids" is an assumed-size array. 117 ! This is the classical case of an array the size of which is 117 ! This is not optimal. 118 ! We are in the classical case of an array the size of which is 118 119 ! unknown in the calling procedure, before the call. 119 120 ! Here we use a better solution: a pointer argument array. … … 121 122 122 123 use netcdf, only: nf90_inquire_variable, nf90_max_var_dims 123 use handle_err_m, only: handle_err124 124 125 125 integer, intent(in):: ncid, varid … … 151 151 ncerr = ncerr_not_opt 152 152 else 153 call handle_err("nf95_inquire_variable", ncerr_not_opt, ncid )153 call handle_err("nf95_inquire_variable", ncerr_not_opt, ncid, varid) 154 154 end if 155 155 … … 161 161 162 162 use netcdf, only: nf90_create 163 use handle_err_m, only: handle_err164 163 165 164 character (len = *), intent(in ) :: path … … 186 185 !************************ 187 186 188 subroutine nf95_def_dim(ncid, name, len, dimid, ncerr)187 subroutine nf95_def_dim(ncid, name, nclen, dimid, ncerr) 189 188 190 189 use netcdf, only: nf90_def_dim 191 use handle_err_m, only: handle_err192 190 193 191 integer, intent( in) :: ncid 194 192 character (len = *), intent( in) :: name 195 integer, intent( in) :: len193 integer, intent( in) :: nclen 196 194 integer, intent(out) :: dimid 197 195 integer, intent(out), optional :: ncerr … … 202 200 !------------------- 203 201 204 ncerr_not_opt = nf90_def_dim(ncid, name, len, dimid)205 if (present(ncerr)) then 206 ncerr = ncerr_not_opt 207 else 208 call handle_err("nf95_def_dim ", ncerr_not_opt, ncid)202 ncerr_not_opt = nf90_def_dim(ncid, name, nclen, dimid) 203 if (present(ncerr)) then 204 ncerr = ncerr_not_opt 205 else 206 call handle_err("nf95_def_dim " // name, ncerr_not_opt, ncid) 209 207 end if 210 208 … … 216 214 217 215 use netcdf, only: nf90_redef 218 use handle_err_m, only: handle_err219 216 220 217 integer, intent( in) :: ncid … … 240 237 241 238 use netcdf, only: nf90_enddef 242 use handle_err_m, only: handle_err243 239 244 240 integer, intent( in) :: ncid … … 265 261 266 262 use netcdf, only: nf90_close 267 use handle_err_m, only: handle_err268 263 269 264 integer, intent( in) :: ncid … … 289 284 290 285 use netcdf, only: nf90_copy_att 291 use handle_err_m, only: handle_err292 286 293 287 integer, intent( in):: ncid_in, varid_in … … 305 299 ncerr = ncerr_not_opt 306 300 else 307 call handle_err("nf95_copy_att ", ncerr_not_opt, ncid_out)301 call handle_err("nf95_copy_att " // name, ncerr_not_opt, ncid_out) 308 302 end if 309 303 310 304 end subroutine nf95_copy_att 311 305 306 !*********************** 307 308 subroutine nf95_inquire_attribute(ncid, varid, name, xtype, nclen, attnum, & 309 ncerr) 310 311 use netcdf, only: nf90_inquire_attribute 312 313 integer, intent( in) :: ncid, varid 314 character (len = *), intent( in) :: name 315 integer, intent(out), optional :: xtype, nclen, attnum 316 integer, intent(out), optional:: ncerr 317 318 ! Variable local to the procedure: 319 integer ncerr_not_opt 320 321 !------------------- 322 323 ncerr_not_opt = nf90_inquire_attribute(ncid, varid, name, xtype, nclen, & 324 attnum) 325 if (present(ncerr)) then 326 ncerr = ncerr_not_opt 327 else 328 call handle_err("nf95_inquire_attribute " // name, ncerr_not_opt, & 329 ncid, varid) 330 end if 331 332 end subroutine nf95_inquire_attribute 333 334 !*********************** 335 336 subroutine nf95_inquire(ncid, nDimensions, nVariables, nAttributes, & 337 unlimitedDimId, formatNum, ncerr) 338 339 use netcdf, only: nf90_inquire 340 341 integer, intent( in) :: ncid 342 integer, optional, intent(out) :: nDimensions, nVariables, nAttributes 343 integer, optional, intent(out) :: unlimitedDimId, formatNum 344 integer, intent(out), optional:: ncerr 345 346 ! Variable local to the procedure: 347 integer ncerr_not_opt 348 349 !------------------- 350 351 ncerr_not_opt = nf90_inquire(ncid, nDimensions, nVariables, nAttributes, & 352 unlimitedDimId, formatNum) 353 if (present(ncerr)) then 354 ncerr = ncerr_not_opt 355 else 356 call handle_err("nf95_inquire", ncerr_not_opt, ncid) 357 end if 358 359 end subroutine nf95_inquire 360 312 361 end module simple -
LMDZ5/branches/testing/libf/dyn3d/calfis.F
r1665 r1669 179 179 ! REAL rdayvrai 180 180 REAL, intent(in):: jD_cur, jH_cur 181 182 LOGICAL tracerdyn 183 181 184 c 182 185 c----------------------------------------------------------------------- … … 459 462 zdqfic(:,:,:)=0. 460 463 461 if (planet_type=="earth") then462 464 #ifdef CPP_PHYS 463 465 … … 467 469 debut_split=debut.and.isplit==1 468 470 lafin_split=lafin.and.isplit==nsplit_phys 471 472 if (planet_type=="earth") then 469 473 470 474 CALL physiq (ngridmx, … … 495 499 . PVteta) 496 500 501 else if ( planet_type=="generic" ) then 502 503 CALL physiq (ngridmx, !! ngrid 504 . llm, !! nlayer 505 . nqtot, !! nq 506 . tname, !! tracer names from dynamical core (given in infotrac) 507 . debut_split, !! firstcall 508 . lafin_split, !! lastcall 509 . float(day_ini), !! pday <-- day_ini (dans temps.h) 510 . jH_cur_split, !! ptime "fraction of day" 511 . zdt_split, !! ptimestep 512 . zplev, !! pplev 513 . zplay, !! pplay 514 . zphi, !! pphi 515 . zufi, !! pu 516 . zvfi, !! pv 517 . ztfi, !! pt 518 . zqfi, !! pq 519 . flxwfi, !! pw !! or 0. anyway this is for diagnostic. not used in physiq. 520 . zdufi, !! pdu 521 . zdvfi, !! pdv 522 . zdtfi, !! pdt 523 . zdqfi, !! pdq 524 . zdpsrf, !! pdpsrf 525 . tracerdyn) !! tracerdyn <-- utilite ??? 526 527 endif ! of if (planet_type=="earth") 528 497 529 zufi(:,:)=zufi(:,:)+zdufi(:,:)*zdt_split 498 530 zvfi(:,:)=zvfi(:,:)+zdvfi(:,:)*zdt_split … … 509 541 #endif 510 542 ! of #ifdef CPP_PHYS 511 endif ! of if (planet_type=="earth")512 543 513 544 zdufi(:,:)=zdufic(:,:)/nsplit_phys -
LMDZ5/branches/testing/libf/dyn3d/comvert.h
r1665 r1669 7 7 COMMON/comvertr/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm), & 8 8 & pa,preff,nivsigs(llm),nivsig(llm+1), & 9 & aps(llm),bps(llm),scaleheight 9 & aps(llm),bps(llm),scaleheight,pseudoalt(llm) 10 10 11 11 common/comverti/disvert_type, pressure_exner … … 23 23 real bps ! hybrid sigma contribution at mid-layers 24 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 25 26 26 27 integer disvert_type ! type of vertical discretization: -
LMDZ5/branches/testing/libf/dyn3d/disvert.F90
r1665 r1669 7 7 use new_unit_m, only: new_unit 8 8 use ioipsl, only: getin 9 use assert_m, only: assert 9 10 10 11 IMPLICIT NONE … … 21 22 22 23 real,intent(in) :: pa, preff 23 real,intent(out) :: ap(llmp1), bp(llmp1) 24 real,intent(out) :: ap(llmp1) ! in Pa 25 real, intent(out):: bp(llmp1) 24 26 real,intent(out) :: dpres(llm), nivsigs(llm), nivsig(llmp1) 25 27 real,intent(out) :: presnivs(llm) … … 79 81 80 82 sig(llm+1)=0. 83 84 bp(: llm) = EXP(1. - 1. / sig(: llm)**2) 85 bp(llmp1) = 0. 86 87 ap = pa * (sig - bp) 81 88 case("tropo") 82 89 DO l = 1, llm … … 89 96 sig(l) = sig(l+1) + dsig(l) 90 97 ENDDO 98 99 bp(1)=1. 100 bp(2: llm) = EXP(1. - 1. / sig(2: llm)**2) 101 bp(llmp1) = 0. 102 103 ap(1)=0. 104 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 91 105 case("strato") 92 106 if (llm==39) then … … 110 124 sig(l) = sig(l+1) + dsig(l) 111 125 ENDDO 126 127 bp(1)=1. 128 bp(2: llm) = EXP(1. - 1. / sig(2: llm)**2) 129 bp(llmp1) = 0. 130 131 ap(1)=0. 132 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 112 133 case("read") 134 ! Read "ap" and "bp". First line is skipped (title line). "ap" 135 ! should be in Pa. First couple of values should correspond to 136 ! the surface, that is : "bp" should be in descending order. 113 137 call new_unit(unit) 114 138 open(unit, file="hybrid.txt", status="old", action="read", & … … 116 140 read(unit, fmt=*) ! skip title line 117 141 do l = 1, llm + 1 118 read(unit, fmt=*) sig(l)142 read(unit, fmt=*) ap(l), bp(l) 119 143 end do 120 144 close(unit) 145 call assert(ap(1) == 0., ap(llm + 1) == 0., bp(1) == 1., & 146 bp(llm + 1) == 0., "disvert: bad ap or bp values") 121 147 case default 122 148 call abort_gcm("disvert", 'Wrong value for "vert_sampling"', 1) … … 130 156 nivsig(l)= REAL(l) 131 157 ENDDO 132 133 ! .... Calculs de ap(l) et de bp(l) ....134 ! ..... pa et preff sont lus sur les fichiers start par lectba .....135 136 bp(llmp1) = 0.137 138 DO l = 1, llm139 bp(l) = EXP( 1. -1./( sig(l)*sig(l)) )140 ap(l) = pa * ( sig(l) - bp(l) )141 ENDDO142 143 bp(1)=1.144 ap(1)=0.145 146 ap(llmp1) = pa * ( sig(llmp1) - bp(llmp1) )147 158 148 159 write(lunout, *) trim(modname),': BP ' -
LMDZ5/branches/testing/libf/dyn3d/disvert_noterre.F
r1520 r1669 46 46 real tt,rr,gg, prevz 47 47 real s(llm),dsig(llm) 48 real pseudoalt(llm)49 48 50 49 integer iz -
LMDZ5/branches/testing/libf/dyn3d/dynetat0.F
r1665 r1669 6 6 7 7 USE infotrac 8 use netcdf, only: nf90_get_var 9 10 use control_mod, only : planet_type 11 8 12 IMPLICIT NONE 9 13 … … 28 32 #include "comconst.h" 29 33 #include "comvert.h" 30 #include "comgeom .h"34 #include "comgeom2.h" 31 35 #include "ener.h" 32 36 #include "netcdf.inc" … … 40 44 41 45 CHARACTER*(*) fichnom 42 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm)43 REAL q(i p1jmp1,llm,nqtot),masse(ip1jmp1,llm)44 REAL ps(i p1jmp1),phis(ip1jmp1)46 REAL vcov(iip1, jjm,llm),ucov(iip1, jjp1,llm),teta(iip1, jjp1,llm) 47 REAL q(iip1,jjp1,llm,nqtot),masse(iip1, jjp1,llm) 48 REAL ps(iip1, jjp1),phis(iip1, jjp1) 45 49 46 50 REAL time … … 52 56 REAL tab_cntrl(length) ! tableau des parametres du run 53 57 INTEGER ierr, nid, nvarid 58 59 INTEGER idecal 54 60 55 61 c----------------------------------------------------------------------- … … 70 76 CALL abort 71 77 ENDIF 72 #ifdef NC_DOUBLE 73 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 74 #else 75 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 76 #endif 78 ierr = nf90_get_var(nid, nvarid, tab_cntrl) 77 79 IF (ierr .NE. NF_NOERR) THEN 78 80 write(lunout,*)"dynetat0: Lecture echoue pour <controle>" 79 81 CALL abort 80 82 ENDIF 83 84 !!! AS: idecal is a hack to be able to read planeto starts... 85 !!! .... while keeping everything OK for LMDZ EARTH 86 if (planet_type.eq."generic") then 87 print*,'NOTE NOTE NOTE : Planeto-like start files' 88 idecal = 4 89 annee_ref = 2000 90 else 91 print*,'NOTE NOTE NOTE : Earth-like start files' 92 idecal = 5 93 annee_ref = tab_cntrl(5) 94 endif 95 81 96 82 97 im = tab_cntrl(1) … … 84 99 lllm = tab_cntrl(3) 85 100 day_ref = tab_cntrl(4) 86 annee_ref = tab_cntrl(5) 87 rad = tab_cntrl(6) 88 omeg = tab_cntrl(7) 89 g = tab_cntrl(8) 90 cpp = tab_cntrl(9) 91 kappa = tab_cntrl(10) 92 daysec = tab_cntrl(11) 93 dtvr = tab_cntrl(12) 94 etot0 = tab_cntrl(13) 95 ptot0 = tab_cntrl(14) 96 ztot0 = tab_cntrl(15) 97 stot0 = tab_cntrl(16) 98 ang0 = tab_cntrl(17) 99 pa = tab_cntrl(18) 100 preff = tab_cntrl(19) 101 c 102 clon = tab_cntrl(20) 103 clat = tab_cntrl(21) 104 grossismx = tab_cntrl(22) 105 grossismy = tab_cntrl(23) 106 c 107 IF ( tab_cntrl(24).EQ.1. ) THEN 101 rad = tab_cntrl(idecal+1) 102 omeg = tab_cntrl(idecal+2) 103 g = tab_cntrl(idecal+3) 104 cpp = tab_cntrl(idecal+4) 105 kappa = tab_cntrl(idecal+5) 106 daysec = tab_cntrl(idecal+6) 107 dtvr = tab_cntrl(idecal+7) 108 etot0 = tab_cntrl(idecal+8) 109 ptot0 = tab_cntrl(idecal+9) 110 ztot0 = tab_cntrl(idecal+10) 111 stot0 = tab_cntrl(idecal+11) 112 ang0 = tab_cntrl(idecal+12) 113 pa = tab_cntrl(idecal+13) 114 preff = tab_cntrl(idecal+14) 115 c 116 clon = tab_cntrl(idecal+15) 117 clat = tab_cntrl(idecal+16) 118 grossismx = tab_cntrl(idecal+17) 119 grossismy = tab_cntrl(idecal+18) 120 c 121 IF ( tab_cntrl(idecal+19).EQ.1. ) THEN 108 122 fxyhypb = . TRUE . 109 123 c dzoomx = tab_cntrl(25) … … 114 128 fxyhypb = . FALSE . 115 129 ysinus = . FALSE . 116 IF( tab_cntrl( 27).EQ.1. ) ysinus = . TRUE.130 IF( tab_cntrl(idecal+22).EQ.1. ) ysinus = . TRUE. 117 131 ENDIF 118 132 … … 142 156 CALL abort 143 157 ENDIF 144 #ifdef NC_DOUBLE 145 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonu) 146 #else 147 ierr = NF_GET_VAR_REAL(nid, nvarid, rlonu) 148 #endif 158 ierr = nf90_get_var(nid, nvarid, rlonu) 149 159 IF (ierr .NE. NF_NOERR) THEN 150 160 write(lunout,*)"dynetat0: Lecture echouee pour <rlonu>" … … 157 167 CALL abort 158 168 ENDIF 159 #ifdef NC_DOUBLE 160 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatu) 161 #else 162 ierr = NF_GET_VAR_REAL(nid, nvarid, rlatu) 163 #endif 169 ierr = nf90_get_var(nid, nvarid, rlatu) 164 170 IF (ierr .NE. NF_NOERR) THEN 165 171 write(lunout,*)"dynetat0: Lecture echouee pour <rlatu>" … … 172 178 CALL abort 173 179 ENDIF 174 #ifdef NC_DOUBLE 175 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonv) 176 #else 177 ierr = NF_GET_VAR_REAL(nid, nvarid, rlonv) 178 #endif 180 ierr = nf90_get_var(nid, nvarid, rlonv) 179 181 IF (ierr .NE. NF_NOERR) THEN 180 182 write(lunout,*)"dynetat0: Lecture echouee pour <rlonv>" … … 187 189 CALL abort 188 190 ENDIF 189 #ifdef NC_DOUBLE 190 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatv) 191 #else 192 ierr = NF_GET_VAR_REAL(nid, nvarid, rlatv) 193 #endif 191 ierr = nf90_get_var(nid, nvarid, rlatv) 194 192 IF (ierr .NE. NF_NOERR) THEN 195 193 write(lunout,*)"dynetat0: Lecture echouee pour rlatv" … … 202 200 CALL abort 203 201 ENDIF 204 #ifdef NC_DOUBLE 205 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cu) 206 #else 207 ierr = NF_GET_VAR_REAL(nid, nvarid, cu) 208 #endif 202 ierr = nf90_get_var(nid, nvarid, cu) 209 203 IF (ierr .NE. NF_NOERR) THEN 210 204 write(lunout,*)"dynetat0: Lecture echouee pour <cu>" … … 217 211 CALL abort 218 212 ENDIF 219 #ifdef NC_DOUBLE 220 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cv) 221 #else 222 ierr = NF_GET_VAR_REAL(nid, nvarid, cv) 223 #endif 213 ierr = nf90_get_var(nid, nvarid, cv) 224 214 IF (ierr .NE. NF_NOERR) THEN 225 215 write(lunout,*)"dynetat0: Lecture echouee pour <cv>" … … 232 222 CALL abort 233 223 ENDIF 234 #ifdef NC_DOUBLE 235 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, aire) 236 #else 237 ierr = NF_GET_VAR_REAL(nid, nvarid, aire) 238 #endif 224 ierr = nf90_get_var(nid, nvarid, aire) 239 225 IF (ierr .NE. NF_NOERR) THEN 240 226 write(lunout,*)"dynetat0: Lecture echouee pour <aire>" … … 247 233 CALL abort 248 234 ENDIF 249 #ifdef NC_DOUBLE 250 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, phis) 251 #else 252 ierr = NF_GET_VAR_REAL(nid, nvarid, phis) 253 #endif 235 ierr = nf90_get_var(nid, nvarid, phis) 254 236 IF (ierr .NE. NF_NOERR) THEN 255 237 write(lunout,*)"dynetat0: Lecture echouee pour <phisinit>" … … 260 242 IF (ierr .NE. NF_NOERR) THEN 261 243 write(lunout,*)"dynetat0: Le champ <temps> est absent" 262 CALL abort 263 ENDIF 264 #ifdef NC_DOUBLE 265 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, time) 266 #else 267 ierr = NF_GET_VAR_REAL(nid, nvarid, time) 268 #endif 244 write(lunout,*)"dynetat0: J essaie <Time>" 245 ierr = NF_INQ_VARID (nid, "Time", nvarid) 246 IF (ierr .NE. NF_NOERR) THEN 247 write(lunout,*)"dynetat0: Le champ <Time> est absent" 248 CALL abort 249 ENDIF 250 ENDIF 251 ierr = nf90_get_var(nid, nvarid, time) 269 252 IF (ierr .NE. NF_NOERR) THEN 270 253 write(lunout,*)"dynetat0: Lecture echouee <temps>" … … 277 260 CALL abort 278 261 ENDIF 279 #ifdef NC_DOUBLE 280 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ucov) 281 #else 282 ierr = NF_GET_VAR_REAL(nid, nvarid, ucov) 283 #endif 262 ierr = nf90_get_var(nid, nvarid, ucov) 284 263 IF (ierr .NE. NF_NOERR) THEN 285 264 write(lunout,*)"dynetat0: Lecture echouee pour <ucov>" … … 292 271 CALL abort 293 272 ENDIF 294 #ifdef NC_DOUBLE 295 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vcov) 296 #else 297 ierr = NF_GET_VAR_REAL(nid, nvarid, vcov) 298 #endif 273 ierr = nf90_get_var(nid, nvarid, vcov) 299 274 IF (ierr .NE. NF_NOERR) THEN 300 275 write(lunout,*)"dynetat0: Lecture echouee pour <vcov>" … … 307 282 CALL abort 308 283 ENDIF 309 #ifdef NC_DOUBLE 310 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, teta) 311 #else 312 ierr = NF_GET_VAR_REAL(nid, nvarid, teta) 313 #endif 284 ierr = nf90_get_var(nid, nvarid, teta) 314 285 IF (ierr .NE. NF_NOERR) THEN 315 286 write(lunout,*)"dynetat0: Lecture echouee pour <teta>" … … 325 296 & "> est absent" 326 297 write(lunout,*)" Il est donc initialise a zero" 327 q(:,:, iq)=0.298 q(:,:,:,iq)=0. 328 299 ELSE 329 #ifdef NC_DOUBLE 330 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, q(1,1,iq)) 331 #else 332 ierr = NF_GET_VAR_REAL(nid, nvarid, q(1,1,iq)) 333 #endif 300 ierr = NF90_GET_VAR(nid, nvarid, q(:,:,:,iq)) 334 301 IF (ierr .NE. NF_NOERR) THEN 335 302 write(lunout,*)"dynetat0: Lecture echouee pour "//tname(iq) … … 345 312 CALL abort 346 313 ENDIF 347 #ifdef NC_DOUBLE 348 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, masse) 349 #else 350 ierr = NF_GET_VAR_REAL(nid, nvarid, masse) 351 #endif 314 ierr = nf90_get_var(nid, nvarid, masse) 352 315 IF (ierr .NE. NF_NOERR) THEN 353 316 write(lunout,*)"dynetat0: Lecture echouee pour <masse>" … … 360 323 CALL abort 361 324 ENDIF 362 #ifdef NC_DOUBLE 363 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ps) 364 #else 365 ierr = NF_GET_VAR_REAL(nid, nvarid, ps) 366 #endif 325 ierr = nf90_get_var(nid, nvarid, ps) 367 326 IF (ierr .NE. NF_NOERR) THEN 368 327 write(lunout,*)"dynetat0: Lecture echouee pour <ps>" -
LMDZ5/branches/testing/libf/dyn3d/dynredem.F
r1665 r1669 8 8 #endif 9 9 USE infotrac 10 use netcdf95, only: NF95_PUT_VAR 10 11 11 12 IMPLICIT NONE … … 19 20 #include "comconst.h" 20 21 #include "comvert.h" 21 #include "comgeom .h"22 #include "comgeom2.h" 22 23 #include "temps.h" 23 24 #include "ener.h" … … 31 32 c ---------- 32 33 INTEGER iday_end 33 REAL phis(i p1jmp1)34 REAL phis(iip1, jjp1) 34 35 CHARACTER*(*) fichnom 35 36 … … 166 167 . "Parametres de controle") 167 168 ierr = NF_ENDDEF(nid) 168 #ifdef NC_DOUBLE 169 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 170 #else 171 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 172 #endif 169 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 173 170 c 174 171 ierr = NF_REDEF (nid) … … 183 180 . "Longitudes des points U") 184 181 ierr = NF_ENDDEF(nid) 185 #ifdef NC_DOUBLE 186 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) 187 #else 188 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) 189 #endif 182 call NF95_PUT_VAR(nid,nvarid,rlonu) 190 183 c 191 184 ierr = NF_REDEF (nid) … … 200 193 . "Latitudes des points U") 201 194 ierr = NF_ENDDEF(nid) 202 #ifdef NC_DOUBLE 203 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) 204 #else 205 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) 206 #endif 195 call NF95_PUT_VAR (nid,nvarid,rlatu) 207 196 c 208 197 ierr = NF_REDEF (nid) … … 217 206 . "Longitudes des points V") 218 207 ierr = NF_ENDDEF(nid) 219 #ifdef NC_DOUBLE 220 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) 221 #else 222 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) 223 #endif 208 call NF95_PUT_VAR(nid,nvarid,rlonv) 224 209 c 225 210 ierr = NF_REDEF (nid) … … 234 219 . "Latitudes des points V") 235 220 ierr = NF_ENDDEF(nid) 236 #ifdef NC_DOUBLE 237 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) 238 #else 239 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) 240 #endif 221 call NF95_PUT_VAR(nid,nvarid,rlatv) 241 222 c 242 223 ierr = NF_REDEF (nid) … … 251 232 . "Numero naturel des couches s") 252 233 ierr = NF_ENDDEF(nid) 253 #ifdef NC_DOUBLE 254 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) 255 #else 256 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) 257 #endif 234 call NF95_PUT_VAR(nid,nvarid,nivsigs) 258 235 c 259 236 ierr = NF_REDEF (nid) … … 268 245 . "Numero naturel des couches sigma") 269 246 ierr = NF_ENDDEF(nid) 270 #ifdef NC_DOUBLE 271 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) 272 #else 273 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) 274 #endif 247 call NF95_PUT_VAR(nid,nvarid,nivsig) 275 248 c 276 249 ierr = NF_REDEF (nid) … … 285 258 . "Coefficient A pour hybride") 286 259 ierr = NF_ENDDEF(nid) 287 #ifdef NC_DOUBLE 288 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) 289 #else 290 ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) 291 #endif 260 call NF95_PUT_VAR(nid,nvarid,ap) 292 261 c 293 262 ierr = NF_REDEF (nid) … … 302 271 . "Coefficient B pour hybride") 303 272 ierr = NF_ENDDEF(nid) 304 #ifdef NC_DOUBLE 305 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) 306 #else 307 ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) 308 #endif 273 call NF95_PUT_VAR(nid,nvarid,bp) 309 274 c 310 275 ierr = NF_REDEF (nid) … … 317 282 cIM 220306 END 318 283 ierr = NF_ENDDEF(nid) 319 #ifdef NC_DOUBLE 320 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) 321 #else 322 ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) 323 #endif 284 call NF95_PUT_VAR(nid,nvarid,presnivs) 324 285 c 325 286 c Coefficients de passage cov. <-> contra. <--> naturel … … 338 299 . "Coefficient de passage pour U") 339 300 ierr = NF_ENDDEF(nid) 340 #ifdef NC_DOUBLE 341 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) 342 #else 343 ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) 344 #endif 301 call NF95_PUT_VAR(nid,nvarid,cu) 345 302 c 346 303 ierr = NF_REDEF (nid) … … 357 314 . "Coefficient de passage pour V") 358 315 ierr = NF_ENDDEF(nid) 359 #ifdef NC_DOUBLE 360 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) 361 #else 362 ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) 363 #endif 316 call NF95_PUT_VAR(nid,nvarid,cv) 364 317 c 365 318 c Aire de chaque maille: … … 378 331 . "Aires de chaque maille") 379 332 ierr = NF_ENDDEF(nid) 380 #ifdef NC_DOUBLE 381 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) 382 #else 383 ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) 384 #endif 333 call NF95_PUT_VAR(nid,nvarid,aire) 385 334 c 386 335 c Geopentiel au sol: … … 399 348 . "Geopotentiel au sol") 400 349 ierr = NF_ENDDEF(nid) 401 #ifdef NC_DOUBLE 402 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) 403 #else 404 ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) 405 #endif 350 call NF95_PUT_VAR(nid,nvarid,phis) 406 351 c 407 352 c Definir les variables pour pouvoir les enregistrer plus tard: … … 524 469 USE infotrac 525 470 USE control_mod 471 use netcdf, only: NF90_get_VAR 472 use netcdf95, only: NF95_PUT_VAR 526 473 527 474 IMPLICIT NONE … … 540 487 541 488 INTEGER l 542 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm)543 REAL teta(i p1jmp1,llm)544 REAL ps(i p1jmp1),masse(ip1jmp1,llm)545 REAL q(i p1jmp1,llm,nqtot)489 REAL vcov(iip1,jjm,llm),ucov(iip1, jjp1,llm) 490 REAL teta(iip1, jjp1,llm) 491 REAL ps(iip1, jjp1),masse(iip1, jjp1,llm) 492 REAL q(iip1, jjp1, llm, nqtot) 546 493 CHARACTER*(*) fichnom 547 494 … … 577 524 CALL abort_gcm(modname,abort_message,ierr) 578 525 ENDIF 579 #ifdef NC_DOUBLE 580 ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,nb,time) 581 #else 582 ierr = NF_PUT_VAR1_REAL (nid,nvarid,nb,time) 583 #endif 526 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 584 527 write(lunout,*) "dynredem1: Enregistrement pour ", nb, time 585 528 … … 593 536 CALL abort_gcm(modname,abort_message,ierr) 594 537 ENDIF 595 #ifdef NC_DOUBLE 596 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 597 #else 598 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 599 #endif 538 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 600 539 tab_cntrl(31) = REAL(itau_dyn + itaufin) 601 #ifdef NC_DOUBLE 602 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 603 #else 604 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 605 #endif 540 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 606 541 607 542 c Ecriture des champs … … 613 548 CALL abort_gcm(modname,abort_message,ierr) 614 549 ENDIF 615 #ifdef NC_DOUBLE 616 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) 617 #else 618 ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) 619 #endif 550 call NF95_PUT_VAR(nid,nvarid,ucov) 620 551 621 552 ierr = NF_INQ_VARID(nid, "vcov", nvarid) … … 625 556 CALL abort_gcm(modname,abort_message,ierr) 626 557 ENDIF 627 #ifdef NC_DOUBLE 628 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) 629 #else 630 ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) 631 #endif 558 call NF95_PUT_VAR(nid,nvarid,vcov) 632 559 633 560 ierr = NF_INQ_VARID(nid, "teta", nvarid) … … 637 564 CALL abort_gcm(modname,abort_message,ierr) 638 565 ENDIF 639 #ifdef NC_DOUBLE 640 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) 641 #else 642 ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) 643 #endif 566 call NF95_PUT_VAR(nid,nvarid,teta) 644 567 645 568 IF (type_trac == 'inca') THEN … … 663 586 CALL abort_gcm(modname,abort_message,ierr) 664 587 ENDIF 665 #ifdef NC_DOUBLE 666 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 667 #else 668 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 669 #endif 588 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 670 589 ELSE ! type_trac = inca 671 590 ! lecture de la valeur du traceur dans start_trac.nc … … 682 601 CALL abort_gcm(modname,abort_message,ierr) 683 602 ENDIF 684 #ifdef NC_DOUBLE 685 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 686 #else 687 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 688 #endif 603 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 689 604 690 605 ELSE 691 606 write(lunout,*) "dynredem1: ",trim(tname(iq)), 692 607 & " est present dans start_trac.nc" 693 #ifdef NC_DOUBLE 694 ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp) 695 #else 696 ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp) 697 #endif 608 ierr = NF90_GET_VAR(nid_trac, nvarid_trac, trac_tmp) 698 609 IF (ierr .NE. NF_NOERR) THEN 699 610 abort_message="dynredem1: Lecture echouee pour"// … … 709 620 CALL abort_gcm(modname,abort_message,ierr) 710 621 ENDIF 711 #ifdef NC_DOUBLE 712 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp) 713 #else 714 ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp) 715 #endif 622 call NF95_PUT_VAR(nid, nvarid, trac_tmp) 716 623 717 624 ENDIF ! IF (ierr .NE. NF_NOERR) … … 726 633 CALL abort_gcm(modname,abort_message,ierr) 727 634 ENDIF 728 #ifdef NC_DOUBLE 729 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 730 #else 731 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 732 #endif 635 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 733 636 ENDIF ! (ierr_file .ne. 2) 734 637 END IF !type_trac … … 743 646 CALL abort_gcm(modname,abort_message,ierr) 744 647 ENDIF 745 #ifdef NC_DOUBLE 746 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) 747 #else 748 ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) 749 #endif 648 call NF95_PUT_VAR(nid,nvarid,masse) 750 649 c 751 650 ierr = NF_INQ_VARID(nid, "ps", nvarid) … … 755 654 CALL abort_gcm(modname,abort_message,ierr) 756 655 ENDIF 757 #ifdef NC_DOUBLE 758 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) 759 #else 760 ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) 761 #endif 656 call NF95_PUT_VAR(nid,nvarid,ps) 762 657 763 658 ierr = NF_CLOSE(nid) -
LMDZ5/branches/testing/libf/dyn3d/leapfrog.F
r1665 r1669 413 413 c-jld 414 414 #ifdef CPP_IOIPSL 415 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 416 IF (first) THEN 417 first=.false. 418 #include "ini_paramLMDZ_dyn.h" 419 ENDIF 420 c 421 #include "write_paramLMDZ_dyn.h" 415 cIM decommenter les 6 lignes suivantes pour sortir quelques parametres dynamiques de LMDZ 416 cIM uncomment next 6 lines to get some parameters for LMDZ dynamics 417 c IF (first) THEN 418 c first=.false. 419 c#include "ini_paramLMDZ_dyn.h" 420 c ENDIF 421 c 422 c#include "write_paramLMDZ_dyn.h" 422 423 c 423 424 #endif -
LMDZ5/branches/testing/libf/dyn3dpar/calfis_p.F
r1665 r1669 242 242 integer :: k,kstart,kend 243 243 INTEGER :: offset 244 245 LOGICAL tracerdyn 244 246 c 245 247 c----------------------------------------------------------------------- … … 636 638 zdqfic_omp(:,:,:)=0. 637 639 638 if (planet_type=="earth") then639 640 #ifdef CPP_PHYS 640 641 do isplit=1,nsplit_phys … … 644 645 lafin_split=lafin.and.isplit==nsplit_phys 645 646 647 if (planet_type=="earth") then 646 648 647 649 CALL physiq (klon, … … 674 676 . PVteta) 675 677 678 else if ( planet_type=="generic" ) then 679 680 CALL physiq (klon, !! ngrid 681 . llm, !! nlayer 682 . nqtot, !! nq 683 . tname, !! tracer names from dynamical core (given in infotrac) 684 . debut_split, !! firstcall 685 . lafin_split, !! lastcall 686 . float(day_ini), !! pday <-- day_ini (dans temps.h) 687 . jH_cur_split, !! ptime "fraction of day" 688 . zdt_split, !! ptimestep 689 . zplev_omp, !! pplev 690 . zplay_omp, !! pplay 691 . zphi_omp, !! pphi 692 . zufi_omp, !! pu 693 . zvfi_omp, !! pv 694 . ztfi_omp, !! pt 695 . zqfi_omp, !! pq 696 . flxwfi_omp, !! pw !! or 0. anyway this is for diagnostic. not used in physiq. 697 . zdufi_omp, !! pdu 698 . zdvfi_omp, !! pdv 699 . zdtfi_omp, !! pdt 700 . zdqfi_omp, !! pdq 701 . zdpsrf_omp, !! pdpsrf 702 . tracerdyn) !! tracerdyn <-- utilite ??? 703 704 endif ! of if (planet_type=="earth") 705 706 676 707 zufi_omp(:,:)=zufi_omp(:,:)+zdufi_omp(:,:)*zdt_split 677 708 zvfi_omp(:,:)=zvfi_omp(:,:)+zdvfi_omp(:,:)*zdt_split … … 688 719 #endif 689 720 ! of #ifdef CPP_PHYS 690 endif !of if (planet_type=="earth")691 721 692 722 zdufi_omp(:,:)=zdufic_omp(:,:)/nsplit_phys -
LMDZ5/branches/testing/libf/dyn3dpar/comvert.h
r1665 r1669 7 7 COMMON/comvertr/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm), & 8 8 & pa,preff,nivsigs(llm),nivsig(llm+1), & 9 & aps(llm),bps(llm),scaleheight 9 & aps(llm),bps(llm),scaleheight,pseudoalt(llm) 10 10 11 11 common/comverti/disvert_type, pressure_exner … … 23 23 real bps ! hybrid sigma contribution at mid-layers 24 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 25 26 26 27 integer disvert_type ! type of vertical discretization: -
LMDZ5/branches/testing/libf/dyn3dpar/disvert.F90
r1665 r1669 7 7 use new_unit_m, only: new_unit 8 8 use ioipsl, only: getin 9 use assert_m, only: assert 9 10 10 11 IMPLICIT NONE … … 21 22 22 23 real,intent(in) :: pa, preff 23 real,intent(out) :: ap(llmp1), bp(llmp1) 24 real,intent(out) :: ap(llmp1) ! in Pa 25 real, intent(out):: bp(llmp1) 24 26 real,intent(out) :: dpres(llm), nivsigs(llm), nivsig(llmp1) 25 27 real,intent(out) :: presnivs(llm) … … 79 81 80 82 sig(llm+1)=0. 83 84 bp(: llm) = EXP(1. - 1. / sig(: llm)**2) 85 bp(llmp1) = 0. 86 87 ap = pa * (sig - bp) 81 88 case("tropo") 82 89 DO l = 1, llm … … 89 96 sig(l) = sig(l+1) + dsig(l) 90 97 ENDDO 98 99 bp(1)=1. 100 bp(2: llm) = EXP(1. - 1. / sig(2: llm)**2) 101 bp(llmp1) = 0. 102 103 ap(1)=0. 104 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 91 105 case("strato") 92 106 if (llm==39) then … … 110 124 sig(l) = sig(l+1) + dsig(l) 111 125 ENDDO 126 127 bp(1)=1. 128 bp(2: llm) = EXP(1. - 1. / sig(2: llm)**2) 129 bp(llmp1) = 0. 130 131 ap(1)=0. 132 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 112 133 case("read") 134 ! Read "ap" and "bp". First line is skipped (title line). "ap" 135 ! should be in Pa. First couple of values should correspond to 136 ! the surface, that is : "bp" should be in descending order. 113 137 call new_unit(unit) 114 138 open(unit, file="hybrid.txt", status="old", action="read", & … … 116 140 read(unit, fmt=*) ! skip title line 117 141 do l = 1, llm + 1 118 read(unit, fmt=*) sig(l)142 read(unit, fmt=*) ap(l), bp(l) 119 143 end do 120 144 close(unit) 145 call assert(ap(1) == 0., ap(llm + 1) == 0., bp(1) == 1., & 146 bp(llm + 1) == 0., "disvert: bad ap or bp values") 121 147 case default 122 148 call abort_gcm("disvert", 'Wrong value for "vert_sampling"', 1) … … 130 156 nivsig(l)= REAL(l) 131 157 ENDDO 132 133 ! .... Calculs de ap(l) et de bp(l) ....134 ! ..... pa et preff sont lus sur les fichiers start par lectba .....135 136 bp(llmp1) = 0.137 138 DO l = 1, llm139 bp(l) = EXP( 1. -1./( sig(l)*sig(l)) )140 ap(l) = pa * ( sig(l) - bp(l) )141 ENDDO142 143 bp(1)=1.144 ap(1)=0.145 146 ap(llmp1) = pa * ( sig(llmp1) - bp(llmp1) )147 158 148 159 write(lunout, *) trim(modname),': BP ' -
LMDZ5/branches/testing/libf/dyn3dpar/disvert_noterre.F
r1520 r1669 46 46 real tt,rr,gg, prevz 47 47 real s(llm),dsig(llm) 48 real pseudoalt(llm)49 48 50 49 integer iz -
LMDZ5/branches/testing/libf/dyn3dpar/dynetat0.F
r1665 r1669 6 6 7 7 USE infotrac 8 use netcdf, only: nf90_get_var 9 10 use control_mod, only : planet_type 11 8 12 IMPLICIT NONE 9 13 … … 28 32 #include "comconst.h" 29 33 #include "comvert.h" 30 #include "comgeom .h"34 #include "comgeom2.h" 31 35 #include "ener.h" 32 36 #include "netcdf.inc" … … 40 44 41 45 CHARACTER*(*) fichnom 42 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm)43 REAL q(i p1jmp1,llm,nqtot),masse(ip1jmp1,llm)44 REAL ps(i p1jmp1),phis(ip1jmp1)46 REAL vcov(iip1, jjm,llm),ucov(iip1, jjp1,llm),teta(iip1, jjp1,llm) 47 REAL q(iip1,jjp1,llm,nqtot),masse(iip1, jjp1,llm) 48 REAL ps(iip1, jjp1),phis(iip1, jjp1) 45 49 46 50 REAL time … … 52 56 REAL tab_cntrl(length) ! tableau des parametres du run 53 57 INTEGER ierr, nid, nvarid 58 59 INTEGER idecal 54 60 55 61 c----------------------------------------------------------------------- … … 70 76 CALL abort 71 77 ENDIF 72 #ifdef NC_DOUBLE 73 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 74 #else 75 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 76 #endif 78 ierr = nf90_get_var(nid, nvarid, tab_cntrl) 77 79 IF (ierr .NE. NF_NOERR) THEN 78 80 write(lunout,*)"dynetat0: Lecture echoue pour <controle>" 79 81 CALL abort 80 82 ENDIF 83 84 !!! AS: idecal is a hack to be able to read planeto starts... 85 !!! .... while keeping everything OK for LMDZ EARTH 86 if (planet_type.eq."generic") then 87 print*,'NOTE NOTE NOTE : Planeto-like start files' 88 idecal = 4 89 annee_ref = 2000 90 else 91 print*,'NOTE NOTE NOTE : Earth-like start files' 92 idecal = 5 93 annee_ref = tab_cntrl(5) 94 endif 95 81 96 82 97 im = tab_cntrl(1) … … 84 99 lllm = tab_cntrl(3) 85 100 day_ref = tab_cntrl(4) 86 annee_ref = tab_cntrl(5) 87 rad = tab_cntrl(6) 88 omeg = tab_cntrl(7) 89 g = tab_cntrl(8) 90 cpp = tab_cntrl(9) 91 kappa = tab_cntrl(10) 92 daysec = tab_cntrl(11) 93 dtvr = tab_cntrl(12) 94 etot0 = tab_cntrl(13) 95 ptot0 = tab_cntrl(14) 96 ztot0 = tab_cntrl(15) 97 stot0 = tab_cntrl(16) 98 ang0 = tab_cntrl(17) 99 pa = tab_cntrl(18) 100 preff = tab_cntrl(19) 101 c 102 clon = tab_cntrl(20) 103 clat = tab_cntrl(21) 104 grossismx = tab_cntrl(22) 105 grossismy = tab_cntrl(23) 106 c 107 IF ( tab_cntrl(24).EQ.1. ) THEN 101 rad = tab_cntrl(idecal+1) 102 omeg = tab_cntrl(idecal+2) 103 g = tab_cntrl(idecal+3) 104 cpp = tab_cntrl(idecal+4) 105 kappa = tab_cntrl(idecal+5) 106 daysec = tab_cntrl(idecal+6) 107 dtvr = tab_cntrl(idecal+7) 108 etot0 = tab_cntrl(idecal+8) 109 ptot0 = tab_cntrl(idecal+9) 110 ztot0 = tab_cntrl(idecal+10) 111 stot0 = tab_cntrl(idecal+11) 112 ang0 = tab_cntrl(idecal+12) 113 pa = tab_cntrl(idecal+13) 114 preff = tab_cntrl(idecal+14) 115 c 116 clon = tab_cntrl(idecal+15) 117 clat = tab_cntrl(idecal+16) 118 grossismx = tab_cntrl(idecal+17) 119 grossismy = tab_cntrl(idecal+18) 120 c 121 IF ( tab_cntrl(idecal+19).EQ.1. ) THEN 108 122 fxyhypb = . TRUE . 109 123 c dzoomx = tab_cntrl(25) … … 114 128 fxyhypb = . FALSE . 115 129 ysinus = . FALSE . 116 IF( tab_cntrl( 27).EQ.1. ) ysinus = . TRUE.130 IF( tab_cntrl(idecal+22).EQ.1. ) ysinus = . TRUE. 117 131 ENDIF 118 132 … … 142 156 CALL abort 143 157 ENDIF 144 #ifdef NC_DOUBLE 145 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonu) 146 #else 147 ierr = NF_GET_VAR_REAL(nid, nvarid, rlonu) 148 #endif 158 ierr = nf90_get_var(nid, nvarid, rlonu) 149 159 IF (ierr .NE. NF_NOERR) THEN 150 160 write(lunout,*)"dynetat0: Lecture echouee pour <rlonu>" … … 157 167 CALL abort 158 168 ENDIF 159 #ifdef NC_DOUBLE 160 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatu) 161 #else 162 ierr = NF_GET_VAR_REAL(nid, nvarid, rlatu) 163 #endif 169 ierr = nf90_get_var(nid, nvarid, rlatu) 164 170 IF (ierr .NE. NF_NOERR) THEN 165 171 write(lunout,*)"dynetat0: Lecture echouee pour <rlatu>" … … 172 178 CALL abort 173 179 ENDIF 174 #ifdef NC_DOUBLE 175 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlonv) 176 #else 177 ierr = NF_GET_VAR_REAL(nid, nvarid, rlonv) 178 #endif 180 ierr = nf90_get_var(nid, nvarid, rlonv) 179 181 IF (ierr .NE. NF_NOERR) THEN 180 182 write(lunout,*)"dynetat0: Lecture echouee pour <rlonv>" … … 187 189 CALL abort 188 190 ENDIF 189 #ifdef NC_DOUBLE 190 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatv) 191 #else 192 ierr = NF_GET_VAR_REAL(nid, nvarid, rlatv) 193 #endif 191 ierr = nf90_get_var(nid, nvarid, rlatv) 194 192 IF (ierr .NE. NF_NOERR) THEN 195 193 write(lunout,*)"dynetat0: Lecture echouee pour rlatv" … … 202 200 CALL abort 203 201 ENDIF 204 #ifdef NC_DOUBLE 205 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cu) 206 #else 207 ierr = NF_GET_VAR_REAL(nid, nvarid, cu) 208 #endif 202 ierr = nf90_get_var(nid, nvarid, cu) 209 203 IF (ierr .NE. NF_NOERR) THEN 210 204 write(lunout,*)"dynetat0: Lecture echouee pour <cu>" … … 217 211 CALL abort 218 212 ENDIF 219 #ifdef NC_DOUBLE 220 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, cv) 221 #else 222 ierr = NF_GET_VAR_REAL(nid, nvarid, cv) 223 #endif 213 ierr = nf90_get_var(nid, nvarid, cv) 224 214 IF (ierr .NE. NF_NOERR) THEN 225 215 write(lunout,*)"dynetat0: Lecture echouee pour <cv>" … … 232 222 CALL abort 233 223 ENDIF 234 #ifdef NC_DOUBLE 235 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, aire) 236 #else 237 ierr = NF_GET_VAR_REAL(nid, nvarid, aire) 238 #endif 224 ierr = nf90_get_var(nid, nvarid, aire) 239 225 IF (ierr .NE. NF_NOERR) THEN 240 226 write(lunout,*)"dynetat0: Lecture echouee pour <aire>" … … 247 233 CALL abort 248 234 ENDIF 249 #ifdef NC_DOUBLE 250 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, phis) 251 #else 252 ierr = NF_GET_VAR_REAL(nid, nvarid, phis) 253 #endif 235 ierr = nf90_get_var(nid, nvarid, phis) 254 236 IF (ierr .NE. NF_NOERR) THEN 255 237 write(lunout,*)"dynetat0: Lecture echouee pour <phisinit>" … … 260 242 IF (ierr .NE. NF_NOERR) THEN 261 243 write(lunout,*)"dynetat0: Le champ <temps> est absent" 262 CALL abort 263 ENDIF 264 #ifdef NC_DOUBLE 265 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, time) 266 #else 267 ierr = NF_GET_VAR_REAL(nid, nvarid, time) 268 #endif 244 write(lunout,*)"dynetat0: J essaie <Time>" 245 ierr = NF_INQ_VARID (nid, "Time", nvarid) 246 IF (ierr .NE. NF_NOERR) THEN 247 write(lunout,*)"dynetat0: Le champ <Time> est absent" 248 CALL abort 249 ENDIF 250 ENDIF 251 ierr = nf90_get_var(nid, nvarid, time) 269 252 IF (ierr .NE. NF_NOERR) THEN 270 253 write(lunout,*)"dynetat0: Lecture echouee <temps>" … … 277 260 CALL abort 278 261 ENDIF 279 #ifdef NC_DOUBLE 280 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ucov) 281 #else 282 ierr = NF_GET_VAR_REAL(nid, nvarid, ucov) 283 #endif 262 ierr = nf90_get_var(nid, nvarid, ucov) 284 263 IF (ierr .NE. NF_NOERR) THEN 285 264 write(lunout,*)"dynetat0: Lecture echouee pour <ucov>" … … 292 271 CALL abort 293 272 ENDIF 294 #ifdef NC_DOUBLE 295 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vcov) 296 #else 297 ierr = NF_GET_VAR_REAL(nid, nvarid, vcov) 298 #endif 273 ierr = nf90_get_var(nid, nvarid, vcov) 299 274 IF (ierr .NE. NF_NOERR) THEN 300 275 write(lunout,*)"dynetat0: Lecture echouee pour <vcov>" … … 307 282 CALL abort 308 283 ENDIF 309 #ifdef NC_DOUBLE 310 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, teta) 311 #else 312 ierr = NF_GET_VAR_REAL(nid, nvarid, teta) 313 #endif 284 ierr = nf90_get_var(nid, nvarid, teta) 314 285 IF (ierr .NE. NF_NOERR) THEN 315 286 write(lunout,*)"dynetat0: Lecture echouee pour <teta>" … … 325 296 & "> est absent" 326 297 write(lunout,*)" Il est donc initialise a zero" 327 q(:,:, iq)=0.298 q(:,:,:,iq)=0. 328 299 ELSE 329 #ifdef NC_DOUBLE 330 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, q(1,1,iq)) 331 #else 332 ierr = NF_GET_VAR_REAL(nid, nvarid, q(1,1,iq)) 333 #endif 300 ierr = NF90_GET_VAR(nid, nvarid, q(:,:,:,iq)) 334 301 IF (ierr .NE. NF_NOERR) THEN 335 302 write(lunout,*)"dynetat0: Lecture echouee pour "//tname(iq) … … 345 312 CALL abort 346 313 ENDIF 347 #ifdef NC_DOUBLE 348 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, masse) 349 #else 350 ierr = NF_GET_VAR_REAL(nid, nvarid, masse) 351 #endif 314 ierr = nf90_get_var(nid, nvarid, masse) 352 315 IF (ierr .NE. NF_NOERR) THEN 353 316 write(lunout,*)"dynetat0: Lecture echouee pour <masse>" … … 360 323 CALL abort 361 324 ENDIF 362 #ifdef NC_DOUBLE 363 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ps) 364 #else 365 ierr = NF_GET_VAR_REAL(nid, nvarid, ps) 366 #endif 325 ierr = nf90_get_var(nid, nvarid, ps) 367 326 IF (ierr .NE. NF_NOERR) THEN 368 327 write(lunout,*)"dynetat0: Lecture echouee pour <ps>" -
LMDZ5/branches/testing/libf/dyn3dpar/dynredem.F
r1665 r1669 8 8 #endif 9 9 USE infotrac 10 use netcdf95, only: NF95_PUT_VAR 10 11 11 12 IMPLICIT NONE … … 19 20 #include "comconst.h" 20 21 #include "comvert.h" 21 #include "comgeom .h"22 #include "comgeom2.h" 22 23 #include "temps.h" 23 24 #include "ener.h" … … 31 32 c ---------- 32 33 INTEGER iday_end 33 REAL phis(i p1jmp1)34 REAL phis(iip1, jjp1) 34 35 CHARACTER*(*) fichnom 35 36 … … 166 167 . "Parametres de controle") 167 168 ierr = NF_ENDDEF(nid) 168 #ifdef NC_DOUBLE 169 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 170 #else 171 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 172 #endif 169 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 173 170 c 174 171 ierr = NF_REDEF (nid) … … 183 180 . "Longitudes des points U") 184 181 ierr = NF_ENDDEF(nid) 185 #ifdef NC_DOUBLE 186 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) 187 #else 188 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) 189 #endif 182 call NF95_PUT_VAR(nid,nvarid,rlonu) 190 183 c 191 184 ierr = NF_REDEF (nid) … … 200 193 . "Latitudes des points U") 201 194 ierr = NF_ENDDEF(nid) 202 #ifdef NC_DOUBLE 203 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) 204 #else 205 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) 206 #endif 195 call NF95_PUT_VAR (nid,nvarid,rlatu) 207 196 c 208 197 ierr = NF_REDEF (nid) … … 217 206 . "Longitudes des points V") 218 207 ierr = NF_ENDDEF(nid) 219 #ifdef NC_DOUBLE 220 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) 221 #else 222 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) 223 #endif 208 call NF95_PUT_VAR(nid,nvarid,rlonv) 224 209 c 225 210 ierr = NF_REDEF (nid) … … 234 219 . "Latitudes des points V") 235 220 ierr = NF_ENDDEF(nid) 236 #ifdef NC_DOUBLE 237 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) 238 #else 239 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) 240 #endif 221 call NF95_PUT_VAR(nid,nvarid,rlatv) 241 222 c 242 223 ierr = NF_REDEF (nid) … … 251 232 . "Numero naturel des couches s") 252 233 ierr = NF_ENDDEF(nid) 253 #ifdef NC_DOUBLE 254 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) 255 #else 256 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) 257 #endif 234 call NF95_PUT_VAR(nid,nvarid,nivsigs) 258 235 c 259 236 ierr = NF_REDEF (nid) … … 268 245 . "Numero naturel des couches sigma") 269 246 ierr = NF_ENDDEF(nid) 270 #ifdef NC_DOUBLE 271 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) 272 #else 273 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) 274 #endif 247 call NF95_PUT_VAR(nid,nvarid,nivsig) 275 248 c 276 249 ierr = NF_REDEF (nid) … … 285 258 . "Coefficient A pour hybride") 286 259 ierr = NF_ENDDEF(nid) 287 #ifdef NC_DOUBLE 288 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) 289 #else 290 ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) 291 #endif 260 call NF95_PUT_VAR(nid,nvarid,ap) 292 261 c 293 262 ierr = NF_REDEF (nid) … … 302 271 . "Coefficient B pour hybride") 303 272 ierr = NF_ENDDEF(nid) 304 #ifdef NC_DOUBLE 305 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) 306 #else 307 ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) 308 #endif 273 call NF95_PUT_VAR(nid,nvarid,bp) 309 274 c 310 275 ierr = NF_REDEF (nid) … … 317 282 cIM 220306 END 318 283 ierr = NF_ENDDEF(nid) 319 #ifdef NC_DOUBLE 320 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) 321 #else 322 ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) 323 #endif 284 call NF95_PUT_VAR(nid,nvarid,presnivs) 324 285 c 325 286 c Coefficients de passage cov. <-> contra. <--> naturel … … 338 299 . "Coefficient de passage pour U") 339 300 ierr = NF_ENDDEF(nid) 340 #ifdef NC_DOUBLE 341 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) 342 #else 343 ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) 344 #endif 301 call NF95_PUT_VAR(nid,nvarid,cu) 345 302 c 346 303 ierr = NF_REDEF (nid) … … 357 314 . "Coefficient de passage pour V") 358 315 ierr = NF_ENDDEF(nid) 359 #ifdef NC_DOUBLE 360 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) 361 #else 362 ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) 363 #endif 316 call NF95_PUT_VAR(nid,nvarid,cv) 364 317 c 365 318 c Aire de chaque maille: … … 378 331 . "Aires de chaque maille") 379 332 ierr = NF_ENDDEF(nid) 380 #ifdef NC_DOUBLE 381 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) 382 #else 383 ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) 384 #endif 333 call NF95_PUT_VAR(nid,nvarid,aire) 385 334 c 386 335 c Geopentiel au sol: … … 399 348 . "Geopotentiel au sol") 400 349 ierr = NF_ENDDEF(nid) 401 #ifdef NC_DOUBLE 402 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) 403 #else 404 ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) 405 #endif 350 call NF95_PUT_VAR(nid,nvarid,phis) 406 351 c 407 352 c Definir les variables pour pouvoir les enregistrer plus tard: … … 524 469 USE infotrac 525 470 USE control_mod 471 use netcdf, only: NF90_get_VAR 472 use netcdf95, only: NF95_PUT_VAR 526 473 527 474 IMPLICIT NONE … … 540 487 541 488 INTEGER l 542 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm)543 REAL teta(i p1jmp1,llm)544 REAL ps(i p1jmp1),masse(ip1jmp1,llm)545 REAL q(i p1jmp1,llm,nqtot)489 REAL vcov(iip1,jjm,llm),ucov(iip1, jjp1,llm) 490 REAL teta(iip1, jjp1,llm) 491 REAL ps(iip1, jjp1),masse(iip1, jjp1,llm) 492 REAL q(iip1, jjp1, llm, nqtot) 546 493 CHARACTER*(*) fichnom 547 494 … … 577 524 CALL abort_gcm(modname,abort_message,ierr) 578 525 ENDIF 579 #ifdef NC_DOUBLE 580 ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,nb,time) 581 #else 582 ierr = NF_PUT_VAR1_REAL (nid,nvarid,nb,time) 583 #endif 526 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 584 527 write(lunout,*) "dynredem1: Enregistrement pour ", nb, time 585 528 … … 593 536 CALL abort_gcm(modname,abort_message,ierr) 594 537 ENDIF 595 #ifdef NC_DOUBLE 596 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 597 #else 598 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 599 #endif 538 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 600 539 tab_cntrl(31) = REAL(itau_dyn + itaufin) 601 #ifdef NC_DOUBLE 602 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 603 #else 604 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 605 #endif 540 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 606 541 607 542 c Ecriture des champs … … 613 548 CALL abort_gcm(modname,abort_message,ierr) 614 549 ENDIF 615 #ifdef NC_DOUBLE 616 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) 617 #else 618 ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) 619 #endif 550 call NF95_PUT_VAR(nid,nvarid,ucov) 620 551 621 552 ierr = NF_INQ_VARID(nid, "vcov", nvarid) … … 625 556 CALL abort_gcm(modname,abort_message,ierr) 626 557 ENDIF 627 #ifdef NC_DOUBLE 628 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) 629 #else 630 ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) 631 #endif 558 call NF95_PUT_VAR(nid,nvarid,vcov) 632 559 633 560 ierr = NF_INQ_VARID(nid, "teta", nvarid) … … 637 564 CALL abort_gcm(modname,abort_message,ierr) 638 565 ENDIF 639 #ifdef NC_DOUBLE 640 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) 641 #else 642 ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) 643 #endif 566 call NF95_PUT_VAR(nid,nvarid,teta) 644 567 645 568 IF (type_trac == 'inca') THEN … … 663 586 CALL abort_gcm(modname,abort_message,ierr) 664 587 ENDIF 665 #ifdef NC_DOUBLE 666 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 667 #else 668 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 669 #endif 670 ELSE ! type_trac=inca 588 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 589 ELSE ! type_trac = inca 671 590 ! lecture de la valeur du traceur dans start_trac.nc 672 591 IF (ierr_file .ne. 2) THEN … … 682 601 CALL abort_gcm(modname,abort_message,ierr) 683 602 ENDIF 684 #ifdef NC_DOUBLE 685 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 686 #else 687 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 688 #endif 603 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 689 604 690 605 ELSE 691 606 write(lunout,*) "dynredem1: ",trim(tname(iq)), 692 607 & " est present dans start_trac.nc" 693 #ifdef NC_DOUBLE 694 ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp) 695 #else 696 ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp) 697 #endif 608 ierr = NF90_GET_VAR(nid_trac, nvarid_trac, trac_tmp) 698 609 IF (ierr .NE. NF_NOERR) THEN 699 610 abort_message="dynredem1: Lecture echouee pour"// … … 709 620 CALL abort_gcm(modname,abort_message,ierr) 710 621 ENDIF 711 #ifdef NC_DOUBLE 712 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp) 713 #else 714 ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp) 715 #endif 622 call NF95_PUT_VAR(nid, nvarid, trac_tmp) 716 623 717 624 ENDIF ! IF (ierr .NE. NF_NOERR) … … 726 633 CALL abort_gcm(modname,abort_message,ierr) 727 634 ENDIF 728 #ifdef NC_DOUBLE 729 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 730 #else 731 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 732 #endif 635 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 733 636 ENDIF ! (ierr_file .ne. 2) 734 END IF ! 637 END IF !type_trac 735 638 736 639 ENDDO … … 743 646 CALL abort_gcm(modname,abort_message,ierr) 744 647 ENDIF 745 #ifdef NC_DOUBLE 746 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) 747 #else 748 ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) 749 #endif 648 call NF95_PUT_VAR(nid,nvarid,masse) 750 649 c 751 650 ierr = NF_INQ_VARID(nid, "ps", nvarid) … … 755 654 CALL abort_gcm(modname,abort_message,ierr) 756 655 ENDIF 757 #ifdef NC_DOUBLE 758 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) 759 #else 760 ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) 761 #endif 656 call NF95_PUT_VAR(nid,nvarid,ps) 762 657 763 658 ierr = NF_CLOSE(nid) -
LMDZ5/branches/testing/libf/dyn3dpar/dynredem_p.F
r1665 r1669 9 9 USE parallel 10 10 USE infotrac 11 use netcdf95, only: NF95_PUT_VAR 12 11 13 IMPLICIT NONE 12 14 c======================================================================= … … 19 21 #include "comconst.h" 20 22 #include "comvert.h" 21 #include "comgeom .h"23 #include "comgeom2.h" 22 24 #include "temps.h" 23 25 #include "ener.h" … … 30 32 c ---------- 31 33 INTEGER iday_end 32 REAL phis(i p1jmp1)34 REAL phis(iip1, jjp1) 33 35 CHARACTER*(*) fichnom 34 36 … … 56 58 character*30 unites 57 59 60 58 61 c----------------------------------------------------------------------- 59 62 if (mpi_rank==0) then … … 69 72 mmois0=1 70 73 jjour0=1 71 #endif 74 #endif 72 75 73 76 DO l=1,length 74 77 tab_cntrl(l) = 0. 75 78 ENDDO 76 tab_cntrl(1) = 77 tab_cntrl(2) = 78 tab_cntrl(3) = 79 tab_cntrl(4) = 80 tab_cntrl(5) = 79 tab_cntrl(1) = REAL(iim) 80 tab_cntrl(2) = REAL(jjm) 81 tab_cntrl(3) = REAL(llm) 82 tab_cntrl(4) = REAL(day_ref) 83 tab_cntrl(5) = REAL(annee_ref) 81 84 tab_cntrl(6) = rad 82 85 tab_cntrl(7) = omeg … … 118 121 ENDIF 119 122 120 tab_cntrl(30) = 121 tab_cntrl(31) = 123 tab_cntrl(30) = REAL(iday_end) 124 tab_cntrl(31) = REAL(itau_dyn + itaufin) 122 125 c start_time: start_time of simulation (not necessarily 0.) 123 126 tab_cntrl(32) = start_time … … 165 168 . "Parametres de controle") 166 169 ierr = NF_ENDDEF(nid) 167 #ifdef NC_DOUBLE 168 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 169 #else 170 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 171 #endif 170 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 172 171 c 173 172 ierr = NF_REDEF (nid) … … 182 181 . "Longitudes des points U") 183 182 ierr = NF_ENDDEF(nid) 184 #ifdef NC_DOUBLE 185 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) 186 #else 187 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) 188 #endif 183 call NF95_PUT_VAR(nid,nvarid,rlonu) 189 184 c 190 185 ierr = NF_REDEF (nid) … … 199 194 . "Latitudes des points U") 200 195 ierr = NF_ENDDEF(nid) 201 #ifdef NC_DOUBLE 202 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) 203 #else 204 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) 205 #endif 196 call NF95_PUT_VAR (nid,nvarid,rlatu) 206 197 c 207 198 ierr = NF_REDEF (nid) … … 216 207 . "Longitudes des points V") 217 208 ierr = NF_ENDDEF(nid) 218 #ifdef NC_DOUBLE 219 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) 220 #else 221 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) 222 #endif 209 call NF95_PUT_VAR(nid,nvarid,rlonv) 223 210 c 224 211 ierr = NF_REDEF (nid) … … 233 220 . "Latitudes des points V") 234 221 ierr = NF_ENDDEF(nid) 235 #ifdef NC_DOUBLE 236 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) 237 #else 238 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) 239 #endif 222 call NF95_PUT_VAR(nid,nvarid,rlatv) 240 223 c 241 224 ierr = NF_REDEF (nid) … … 250 233 . "Numero naturel des couches s") 251 234 ierr = NF_ENDDEF(nid) 252 #ifdef NC_DOUBLE 253 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) 254 #else 255 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) 256 #endif 235 call NF95_PUT_VAR(nid,nvarid,nivsigs) 257 236 c 258 237 ierr = NF_REDEF (nid) … … 267 246 . "Numero naturel des couches sigma") 268 247 ierr = NF_ENDDEF(nid) 269 #ifdef NC_DOUBLE 270 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) 271 #else 272 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) 273 #endif 248 call NF95_PUT_VAR(nid,nvarid,nivsig) 274 249 c 275 250 ierr = NF_REDEF (nid) … … 284 259 . "Coefficient A pour hybride") 285 260 ierr = NF_ENDDEF(nid) 286 #ifdef NC_DOUBLE 287 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) 288 #else 289 ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) 290 #endif 261 call NF95_PUT_VAR(nid,nvarid,ap) 291 262 c 292 263 ierr = NF_REDEF (nid) … … 301 272 . "Coefficient B pour hybride") 302 273 ierr = NF_ENDDEF(nid) 303 #ifdef NC_DOUBLE 304 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) 305 #else 306 ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) 307 #endif 274 call NF95_PUT_VAR(nid,nvarid,bp) 308 275 c 309 276 ierr = NF_REDEF (nid) … … 316 283 cIM 220306 END 317 284 ierr = NF_ENDDEF(nid) 318 #ifdef NC_DOUBLE 319 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) 320 #else 321 ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) 322 #endif 285 call NF95_PUT_VAR(nid,nvarid,presnivs) 323 286 c 324 287 c Coefficients de passage cov. <-> contra. <--> naturel … … 337 300 . "Coefficient de passage pour U") 338 301 ierr = NF_ENDDEF(nid) 339 #ifdef NC_DOUBLE 340 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) 341 #else 342 ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) 343 #endif 302 call NF95_PUT_VAR(nid,nvarid,cu) 344 303 c 345 304 ierr = NF_REDEF (nid) … … 356 315 . "Coefficient de passage pour V") 357 316 ierr = NF_ENDDEF(nid) 358 #ifdef NC_DOUBLE 359 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) 360 #else 361 ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) 362 #endif 317 call NF95_PUT_VAR(nid,nvarid,cv) 363 318 c 364 319 c Aire de chaque maille: … … 377 332 . "Aires de chaque maille") 378 333 ierr = NF_ENDDEF(nid) 379 #ifdef NC_DOUBLE 380 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) 381 #else 382 ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) 383 #endif 334 call NF95_PUT_VAR(nid,nvarid,aire) 384 335 c 385 336 c Geopentiel au sol: … … 398 349 . "Geopotentiel au sol") 399 350 ierr = NF_ENDDEF(nid) 400 #ifdef NC_DOUBLE 401 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) 402 #else 403 ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) 404 #endif 351 call NF95_PUT_VAR(nid,nvarid,phis) 405 352 c 406 353 c Definir les variables pour pouvoir les enregistrer plus tard: … … 510 457 ierr = NF_ENDDEF(nid) ! sortir du mode de definition 511 458 ierr = NF_CLOSE(nid) ! fermer le fichier 512 513 459 514 460 PRINT*,'iim,jjm,llm,iday_end',iim,jjm,llm,iday_end … … 524 470 USE infotrac 525 471 USE control_mod 472 use netcdf, only: NF90_get_VAR 473 use netcdf95, only: NF95_PUT_VAR 474 526 475 IMPLICIT NONE 527 476 c================================================================= … … 536 485 #include "temps.h" 537 486 487 538 488 INTEGER l 539 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm)540 REAL teta(i p1jmp1,llm)541 REAL ps(i p1jmp1),masse(ip1jmp1,llm)542 REAL q(i p1jmp1,llm,nqtot)489 REAL vcov(iip1,jjm,llm),ucov(iip1, jjp1,llm) 490 REAL teta(iip1, jjp1,llm) 491 REAL ps(iip1, jjp1),masse(iip1, jjp1,llm) 492 REAL q(iip1, jjp1, llm, nqtot) 543 493 CHARACTER*(*) fichnom 544 494 … … 546 496 INTEGER nid, nvarid, nid_trac, nvarid_trac 547 497 REAL trac_tmp(ip1jmp1,llm) 548 INTEGER ierr, ierr_file 498 INTEGER ierr, ierr_file 549 499 INTEGER iq 550 500 INTEGER length … … 567 517 568 518 do iq=1,nqtot 569 call Gather_Field(q( 1,1,iq),ip1jmp1,llm,0)519 call Gather_Field(q(:,:,:,iq),ip1jmp1,llm,0) 570 520 enddo 571 521 … … 589 539 CALL abort_gcm(modname,abort_message,ierr) 590 540 ENDIF 591 #ifdef NC_DOUBLE 592 ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,nb,time) 593 #else 594 ierr = NF_PUT_VAR1_REAL (nid,nvarid,nb,time) 595 #endif 541 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 596 542 PRINT*, "Enregistrement pour ", nb, time 597 543 … … 605 551 CALL abort_gcm(modname,abort_message,ierr) 606 552 ENDIF 607 #ifdef NC_DOUBLE 608 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 609 #else 610 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 611 #endif 612 tab_cntrl(31) = REAL(itau_dyn + itaufin) 613 #ifdef NC_DOUBLE 614 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 615 #else 616 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 617 #endif 553 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 554 tab_cntrl(31) = REAL(itau_dyn + itaufin) 555 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 618 556 619 557 c Ecriture des champs … … 624 562 CALL abort 625 563 ENDIF 626 #ifdef NC_DOUBLE 627 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) 628 #else 629 ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) 630 #endif 564 call NF95_PUT_VAR(nid,nvarid,ucov) 631 565 632 566 ierr = NF_INQ_VARID(nid, "vcov", nvarid) … … 635 569 CALL abort 636 570 ENDIF 637 #ifdef NC_DOUBLE 638 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) 639 #else 640 ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) 641 #endif 571 call NF95_PUT_VAR(nid,nvarid,vcov) 642 572 643 573 ierr = NF_INQ_VARID(nid, "teta", nvarid) … … 646 576 CALL abort 647 577 ENDIF 648 #ifdef NC_DOUBLE 649 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) 650 #else 651 ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) 652 #endif 578 call NF95_PUT_VAR(nid,nvarid,teta) 653 579 654 580 IF (type_trac == 'inca') THEN … … 675 601 CALL abort 676 602 ENDIF 677 #ifdef NC_DOUBLE 678 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 679 #else 680 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 681 #endif 603 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 682 604 ELSE ! type_trac = inca 683 605 ! lecture de la valeur du traceur dans start_trac.nc … … 691 613 CALL abort 692 614 ENDIF 693 #ifdef NC_DOUBLE 694 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 695 #else 696 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 697 #endif 615 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 698 616 699 617 ELSE 700 618 PRINT*, tname(iq), "est present dans start_trac.nc" 701 #ifdef NC_DOUBLE 702 ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp) 703 #else 704 ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp) 705 #endif 619 ierr = NF90_GET_VAR(nid_trac, nvarid_trac, trac_tmp) 706 620 IF (ierr .NE. NF_NOERR) THEN 707 621 PRINT*, "Lecture echouee pour", tname(iq) … … 713 627 CALL abort 714 628 ENDIF 715 #ifdef NC_DOUBLE 716 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp) 717 #else 718 ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp) 719 #endif 629 call NF95_PUT_VAR(nid, nvarid, trac_tmp) 720 630 721 631 ENDIF ! IF (ierr .NE. NF_NOERR) … … 728 638 CALL abort 729 639 ENDIF 730 #ifdef NC_DOUBLE 731 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 732 #else 733 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 734 #endif 640 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 735 641 ENDIF ! (ierr_file .ne. 2) 736 END IF ! 642 END IF !type_trac 737 643 738 644 ENDDO … … 746 652 CALL abort 747 653 ENDIF 748 #ifdef NC_DOUBLE 749 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) 750 #else 751 ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) 752 #endif 654 call NF95_PUT_VAR(nid,nvarid,masse) 753 655 c 754 656 ierr = NF_INQ_VARID(nid, "ps", nvarid) … … 757 659 CALL abort 758 660 ENDIF 759 #ifdef NC_DOUBLE 760 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) 761 #else 762 ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) 763 #endif 661 call NF95_PUT_VAR(nid,nvarid,ps) 764 662 765 663 ierr = NF_CLOSE(nid) -
LMDZ5/branches/testing/libf/phy1d/lmdz1d.F
r1665 r1669 273 273 elseif (forcing_type .eq.61) THEN 274 274 forcing_armcu = .true. 275 IF(llm.NE.19.AND.llm.NE.40) stop 'Erreur nombre de niveaux !!' 275 276 else 276 277 write (*,*) 'ERROR : unknown forcing_type ', forcing_type … … 399 400 rho(1)=psurf/(rd*tsurf*(1.+(rv/rd-1.)*qsurf)) 400 401 401 ok_flux_surf=.false. 402 fsens=-wtsurf*rcpd*rho(1) 403 flat=-wqsurf*rlvtt*rho(1) 402 ! 403 !! mpl et jyg le 22/08/2012 : 404 !! pour que les cas a flux de surface imposes marchent 405 IF(.NOT.ok_flux_surf) THEN 406 fsens=-wtsurf*rcpd*rho(1) 407 flat=-wqsurf*rlvtt*rho(1) 408 print *,'Flux: ok_flux wtsurf wqsurf',ok_flux_surf,wtsurf,wqsurf 409 ENDIF 410 !! ok_flux_surf=.false. 411 !! fsens=-wtsurf*rcpd*rho(1) 412 !! flat=-wqsurf*rlvtt*rho(1) 413 !!!! 404 414 405 415 ! Vertical discretization and pressure levels at half and mid levels: -
LMDZ5/branches/testing/libf/phylmd/calltherm.F90
r1517 r1669 8 8 & ,fm_therm,entr_therm,detr_therm,zqasc,clwcon0,lmax,ratqscth, & 9 9 & ratqsdiff,zqsatth,Ale_bl,Alp_bl,lalim_conv,wght_th, & 10 & zmax0,f0,zw2,fraca,ztv,zpspsk,ztla,zthl) 10 & zmax0,f0,zw2,fraca,ztv,zpspsk,ztla,zthl & 11 !!! nrlmd le 10/04/2012 12 & ,pbl_tke,pctsrf,omega,airephy & 13 & ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 & 14 & ,n2,s2,ale_bl_stat & 15 & ,therm_tke_max,env_tke_max & 16 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & 17 & ,alp_bl_conv,alp_bl_stat & 18 !!! fin nrlmd le 10/04/2012 19 & ) 11 20 12 21 USE dimphy … … 16 25 #include "thermcell.h" 17 26 #include "iniprint.h" 27 28 !!! nrlmd le 10/04/2012 29 #include "indicesol.h" 30 !!! fin nrlmd le 10/04/2012 18 31 19 32 !IM 140508 … … 75 88 !on garde le zmax du pas de temps precedent 76 89 real zmax0(klon), f0(klon) 90 91 !!! nrlmd le 10/04/2012 92 real pbl_tke(klon,klev+1,nbsrf) 93 real pctsrf(klon,nbsrf) 94 real omega(klon,klev) 95 real airephy(klon) 96 real zlcl_th(klon),fraca0(klon),w0(klon),w_conv(klon) 97 real therm_tke_max0(klon),env_tke_max0(klon) 98 real n2(klon),s2(klon) 99 real ale_bl_stat(klon) 100 real therm_tke_max(klon,klev),env_tke_max(klon,klev) 101 real alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon) 102 !!! fin nrlmd le 10/04/2012 103 77 104 !******************************************************** 78 105 … … 220 247 & ,Ale,Alp,lalim_conv,wght_th & 221 248 & ,zmax0,f0,zw2,fraca,ztv,zpspsk & 222 & ,ztla,zthl) 249 & ,ztla,zthl & 250 !!! nrlmd le 10/04/2012 251 & ,pbl_tke,pctsrf,omega,airephy & 252 & ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 & 253 & ,n2,s2,ale_bl_stat & 254 & ,therm_tke_max,env_tke_max & 255 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & 256 & ,alp_bl_conv,alp_bl_stat & 257 !!! fin nrlmd le 10/04/2012 258 & ) 223 259 if (prt_level.gt.10) write(lunout,*)'Apres thermcell_main OK' 224 260 else … … 227 263 endif 228 264 229 flag_bidouille_stratocu=iflag_thermals.eq.14.or.iflag_thermals.eq.16 265 ! Attention : les noms sont contre intuitif. 266 ! flag_bidouille_stratocu est .true. si on ne fait pas de bidouille. 267 ! Il aurait mieux valu avoir un nobidouille_stratocu 268 ! Et pour simplifier : 269 ! nobidouille_stratocu=.not.(iflag_thermals==13.or.iflag_thermals=15) 270 ! Ce serait bien de changer, mai en prenant le temps de vérifier que ca 271 ! fait bien ce qu'on croit. 272 273 flag_bidouille_stratocu=iflag_thermals<=12.or.iflag_thermals==14.or.iflag_thermals==16 274 275 if (iflag_thermals<=12) then 276 lmax=1 277 do k=1,klev-1 278 zdetr_therm(:,k)=zentr_therm(:,k)+zfm_therm(:,k)-zfm_therm(:,k+1) 279 enddo 280 endif 230 281 231 282 fact(:)=0. … … 267 318 268 319 DO i=1,klon 269 if(prt_level.GE.10) print*,'calltherm i Alp_bl Alp Ale_bl Ale',i,Alp_bl(i),Alp(i),Ale_bl(i),Ale(i)270 320 fm_therm(i,klev+1)=0. 271 321 Ale_bl(i)=Ale_bl(i)+Ale(i)/REAL(nsplit_thermals) … … 273 323 Alp_bl(i)=Alp_bl(i)+Alp(i)/REAL(nsplit_thermals) 274 324 ! write(23,*)'ALP CALLTHERM',Alp_bl(i),Alp(i) 325 if(prt_level.GE.10) print*,'calltherm i Alp_bl Alp Ale_bl Ale',i,Alp_bl(i),Alp(i),Ale_bl(i),Ale(i) 275 326 ENDDO 276 327 -
LMDZ5/branches/testing/libf/phylmd/concvl.F
r1665 r1669 248 248 DO i = 1, klon 249 249 cbmf(i) = 0. 250 !plcl(i) = 0.250 plcl(i) = 0. 251 251 sigd(i) = 0. 252 252 ENDDO … … 256 256 plfc(:) = 0. 257 257 wbeff(:) = 100. 258 plcl(:) = 0.259 258 260 259 DO k = 1, klev+1 … … 369 368 $ cape,cin,tvp, 370 369 $ dd_t,dd_q,Plim1,Plim2,asupmax,supmax0, 371 $ asupmaxmin,lalim_conv) 370 $ asupmaxmin,lalim_conv, 371 !AC! 372 $ da,phi) 373 !AC! 372 374 endif 373 375 C------------------------------------------------------------------ … … 399 401 ENDDO 400 402 endif 403 404 c!AC! 405 if (iflag_con.eq.3) then 406 DO itra = 1,ntra 407 DO k = 1, klev 408 DO i = 1, klon 409 d_tra(i,k,itra) =dtime*d_tra(i,k,itra) 410 ENDDO 411 ENDDO 412 ENDDO 413 endif 414 c!AC! 401 415 402 416 DO k = 1, klev -
LMDZ5/branches/testing/libf/phylmd/conf_phys.F90
r1664 r1669 110 110 integer,SAVE :: iflag_thermals_omp,nsplit_thermals_omp 111 111 real,save :: tau_thermals_omp,alp_bl_k_omp 112 !!! nrlmd le 10/04/2012 113 integer,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp 114 integer,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp 115 real,SAVE :: s_trig_omp 116 !!! fin nrlmd le 10/04/2012 112 117 real :: alp_offset 113 118 REAL, SAVE :: alp_offset_omp … … 282 287 !Config Help = Used in physiq.F 283 288 ! 289 ! - flag_aerosol=0 => no aerosol 284 290 ! - flag_aerosol=1 => so4 only (defaut) 285 291 ! - flag_aerosol=2 => bc only … … 289 295 ! - flag_aerosol=6 => all aerosol 290 296 291 flag_aerosol_omp = 1297 flag_aerosol_omp = 0 292 298 CALL getin('flag_aerosol',flag_aerosol_omp) 293 299 … … 1083 1089 alp_bl_k_omp = 1. 1084 1090 call getin('alp_bl_k',alp_bl_k_omp) 1091 1092 !!! nrlmd le 10/04/2012 1093 1094 !Config Key = iflag_trig_bl 1095 !Config Desc = 1096 !Config Def = 0 1097 !Config Help = 1098 ! 1099 iflag_trig_bl_omp = 0 1100 call getin('iflag_trig_bl',iflag_trig_bl_omp) 1101 1102 !Config Key = s_trig_bl 1103 !Config Desc = 1104 !Config Def = 0 1105 !Config Help = 1106 ! 1107 s_trig_omp = 2e7 1108 call getin('s_trig',s_trig_omp) 1109 1110 !Config Key = tau_trig_shallow 1111 !Config Desc = 1112 !Config Def = 0 1113 !Config Help = 1114 ! 1115 tau_trig_shallow_omp = 600 1116 call getin('tau_trig_shallow',tau_trig_shallow_omp) 1117 1118 !Config Key = tau_trig_deep 1119 !Config Desc = 1120 !Config Def = 0 1121 !Config Help = 1122 ! 1123 tau_trig_deep_omp = 1800 1124 call getin('tau_trig_deep',tau_trig_deep_omp) 1125 1126 !Config Key = iflag_clos_bl 1127 !Config Desc = 1128 !Config Def = 0 1129 !Config Help = 1130 ! 1131 iflag_clos_bl_omp = 0 1132 call getin('iflag_clos_bl',iflag_clos_bl_omp) 1133 1134 !!! fin nrlmd le 10/04/2012 1085 1135 1086 1136 ! … … 1650 1700 tau_thermals = tau_thermals_omp 1651 1701 alp_bl_k = alp_bl_k_omp 1702 !!! nrlmd le 10/04/2012 1703 iflag_trig_bl = iflag_trig_bl_omp 1704 s_trig = s_trig_omp 1705 tau_trig_shallow = tau_trig_shallow_omp 1706 tau_trig_deep = tau_trig_deep_omp 1707 iflag_clos_bl = iflag_clos_bl_omp 1708 !!! fin nrlmd le 10/04/2012 1652 1709 iflag_coupl = iflag_coupl_omp 1653 1710 iflag_clos = iflag_clos_omp … … 1710 1767 ! il n'est utilisable que lors du couplage avec le SO4 seul 1711 1768 IF (ok_ade .OR. ok_aie) THEN 1769 IF ( flag_aerosol .EQ. 0 ) THEN 1770 CALL abort_gcm('conf_phys','flag_aerosol=0 not compatible avec ok_ade ou ok_aie=.TRUE.',1) 1771 END IF 1712 1772 IF ( .NOT. new_aod .AND. flag_aerosol .NE. 1) THEN 1713 1773 CALL abort_gcm('conf_phys','new_aod=.FALSE. not compatible avec flag_aerosol=1',1) … … 1839 1899 write(lunout,*)' iflag_wake = ', iflag_wake 1840 1900 write(lunout,*)' alp_offset = ', alp_offset 1901 !!! nrlmd le 10/04/2012 1902 write(lunout,*)' iflag_trig_bl = ', iflag_trig_bl 1903 write(lunout,*)' s_trig = ', s_trig 1904 write(lunout,*)' tau_trig_shallow = ', tau_trig_shallow 1905 write(lunout,*)' tau_trig_deep = ', tau_trig_deep 1906 write(lunout,*)' iflag_clos_bl = ', iflag_clos_bl 1907 !!! fin nrlmd le 10/04/2012 1841 1908 1842 1909 write(lunout,*)' lonmin lonmax latmin latmax bilKP_ins =',& -
LMDZ5/branches/testing/libf/phylmd/cv3_routines.F
r1554 r1669 879 879 110 continue 880 880 881 do 121 j=1,ntra882 ccccc do 111 k=1,nl+1883 do 111 k=1,nd884 nn=0885 do 101 i=1,len886 if(iflag1(i).eq.0)then887 nn=nn+1888 tra(nn,k,j)=tra1(i,k,j)889 endif890 101 continue891 111 continue892 121 continue881 !AC! do 121 j=1,ntra 882 !AC!ccccc do 111 k=1,nl+1 883 !AC! do 111 k=1,nd 884 !AC! nn=0 885 !AC! do 101 i=1,len 886 !AC! if(iflag1(i).eq.0)then 887 !AC! nn=nn+1 888 !AC! tra(nn,k,j)=tra1(i,k,j) 889 !AC! endif 890 !AC! 101 continue 891 !AC! 111 continue 892 !AC! 121 continue 893 893 894 894 if (nn.ne.ncum) then … … 1633 1633 sij(1:ncum,1:nd,1:nd)=0.0 1634 1634 1635 do k=1,ntra1636 do j=1,nd ! instead nlp1637 do i=1,nd ! instead nlp1638 do il=1,ncum1639 traent(il,i,j,k)=tra(il,j,k)1640 enddo1641 enddo1642 enddo1643 enddo1635 !AC! do k=1,ntra 1636 !AC! do j=1,nd ! instead nlp 1637 !AC! do i=1,nd ! instead nlp 1638 !AC! do il=1,ncum 1639 !AC! traent(il,i,j,k)=tra(il,j,k) 1640 !AC! enddo 1641 !AC! enddo 1642 !AC! enddo 1643 !AC! enddo 1644 1644 zm(:,:)=0. 1645 1645 … … 1697 1697 710 continue 1698 1698 1699 do k=1,ntra1700 do j=minorig,nl1701 do il=1,ncum1702 if( (i.ge.icb(il)).and.(i.le.inb(il)).and.1703 : (j.ge.(icb(il)-1)).and.(j.le.inb(il)))then1704 traent(il,i,j,k)=sij(il,i,j)*tra(il,i,k)1705 : +(1.-sij(il,i,j))*tra(il,nk(il),k)1706 endif1707 enddo1708 enddo1709 enddo1699 !AC! do k=1,ntra 1700 !AC! do j=minorig,nl 1701 !AC! do il=1,ncum 1702 !AC! if( (i.ge.icb(il)).and.(i.le.inb(il)).and. 1703 !AC! : (j.ge.(icb(il)-1)).and.(j.le.inb(il)))then 1704 !AC! traent(il,i,j,k)=sij(il,i,j)*tra(il,i,k) 1705 !AC! : +(1.-sij(il,i,j))*tra(il,nk(il),k) 1706 !AC! endif 1707 !AC! enddo 1708 !AC! enddo 1709 !AC! enddo 1710 1710 1711 1711 c … … 1730 1730 750 continue 1731 1731 1732 do j=1,ntra1733 do i=minorig+1,nl1734 do il=1,ncum1735 if (i.ge.icb(il) .and. i.le.inb(il) .and. nent(il,i).eq.0) then1736 traent(il,i,i,j)=tra(il,nk(il),j)1737 endif1738 enddo1739 enddo1740 enddo1732 !AC! do j=1,ntra 1733 !AC! do i=minorig+1,nl 1734 !AC! do il=1,ncum 1735 !AC! if (i.ge.icb(il) .and. i.le.inb(il) .and. nent(il,i).eq.0) then 1736 !AC! traent(il,i,i,j)=tra(il,nk(il),j) 1737 !AC! endif 1738 !AC! enddo 1739 !AC! enddo 1740 !AC! enddo 1741 1741 1742 1742 do 100 j=minorig,nl … … 1904 1904 enddo ! il 1905 1905 1906 do j=1,ntra1907 do il=1,ncum1908 if ( i.ge.icb(il) .and. i.le.inb(il) .and. lwork(il)1909 : .and. csum(il,i).lt.m(il,i) ) then1910 traent(il,i,i,j)=tra(il,nk(il),j)1911 endif1912 enddo1913 enddo1906 !AC! do j=1,ntra 1907 !AC! do il=1,ncum 1908 !AC! if ( i.ge.icb(il) .and. i.le.inb(il) .and. lwork(il) 1909 !AC! : .and. csum(il,i).lt.m(il,i) ) then 1910 !AC! traent(il,i,i,j)=tra(il,nk(il),j) 1911 !AC! endif 1912 !AC! enddo 1913 !AC! enddo 1914 1914 789 continue 1915 1915 c … … 2014 2014 enddo 2015 2015 enddo 2016 do k=1,ntra2017 do i=1,nd2018 do il=1,ncum2019 trap(il,i,k)=tra(il,i,k)2020 enddo2021 enddo2022 enddo2016 !AC! do k=1,ntra 2017 !AC! do i=1,nd 2018 !AC! do il=1,ncum 2019 !AC! trap(il,i,k)=tra(il,i,k) 2020 !AC! enddo 2021 !AC! enddo 2022 !AC! enddo 2023 2023 c 2024 2024 c *** check whether ep(inb)=0, if so, skip precipitating *** … … 2341 2341 c *** find tracer concentrations in precipitating downdraft *** 2342 2342 c 2343 do j=1,ntra2344 do il = 1,ncum2345 if (i.lt.inb(il) .and. lwork(il)) then2346 c2347 if(mplus(il))then2348 trap(il,i,j)=trap(il,i+1,j)*mp(il,i+1)2349 : +trap(il,i,j)*(mp(il,i)-mp(il,i+1))2350 trap(il,i,j)=trap(il,i,j)/mp(il,i)2351 else ! if (mplus(il))2352 if(mp(il,i+1).gt.1.0e-16)then2353 trap(il,i,j)=trap(il,i+1,j)2354 endif2355 endif ! (mplus(il)) else if (.not.mplus(il))2356 c2357 endif ! (i.lt.inb(il) .and. lwork(il))2358 enddo2359 end do2343 !AC! do j=1,ntra 2344 !AC! do il = 1,ncum 2345 !AC! if (i.lt.inb(il) .and. lwork(il)) then 2346 !AC!c 2347 !AC! if(mplus(il))then 2348 !AC! trap(il,i,j)=trap(il,i+1,j)*mp(il,i+1) 2349 !AC! : +trap(il,i,j)*(mp(il,i)-mp(il,i+1)) 2350 !AC! trap(il,i,j)=trap(il,i,j)/mp(il,i) 2351 !AC! else ! if (mplus(il)) 2352 !AC! if(mp(il,i+1).gt.1.0e-16)then 2353 !AC! trap(il,i,j)=trap(il,i+1,j) 2354 !AC! endif 2355 !AC! endif ! (mplus(il)) else if (.not.mplus(il)) 2356 !AC!c 2357 !AC! endif ! (i.lt.inb(il) .and. lwork(il)) 2358 !AC! enddo 2359 !AC! end do 2360 2360 2361 2361 400 continue … … 2484 2484 enddo 2485 2485 c print*,'cv3_yield initialisation 2' 2486 do j=1,ntra2487 do i=1,nd2488 do il=1,ncum2489 ftra(il,i,j)=0.02490 enddo2491 enddo2492 enddo2486 !AC! do j=1,ntra 2487 !AC! do i=1,nd 2488 !AC! do il=1,ncum 2489 !AC! ftra(il,i,j)=0.0 2490 !AC! enddo 2491 !AC! enddo 2492 !AC! enddo 2493 2493 c print*,'cv3_yield initialisation 3' 2494 2494 do i=1,nl … … 2649 2649 2650 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2651 !AC! do j=1,ntra 2652 !AC! do il=1,ncum 2653 !AC! if (iflag(il) .le. 1) then 2654 !AC! if (cvflag_grav) then 2655 !AC! ftra(il,1,j)=ftra(il,1,j)+0.01*grav*work(il) 2656 !AC! : *(mp(il,2)*(trap(il,2,j)-tra(il,1,j)) 2657 !AC! : +am(il)*(tra(il,2,j)-tra(il,1,j))) 2658 !AC! else 2659 !AC! ftra(il,1,j)=ftra(il,1,j)+0.1*work(il) 2660 !AC! : *(mp(il,2)*(trap(il,2,j)-tra(il,1,j)) 2661 !AC! : +am(il)*(tra(il,2,j)-tra(il,1,j))) 2662 !AC! endif 2663 !AC! endif ! iflag 2664 !AC! enddo 2665 !AC! enddo 2666 2666 2667 2667 do j=2,nl … … 2687 2687 enddo 2688 2688 2689 do k=1,ntra2690 do j=2,nl2691 do il=1,ncum2692 if (j.le.inb(il) .and. iflag(il) .le. 1) then2693 2694 if (cvflag_grav) then2695 ftra(il,1,k)=ftra(il,1,k)+0.01*grav*work(il)*ment(il,j,1)2696 : *(traent(il,j,1,k)-tra(il,1,k))2697 else2698 ftra(il,1,k)=ftra(il,1,k)+0.1*work(il)*ment(il,j,1)2699 : *(traent(il,j,1,k)-tra(il,1,k))2700 endif2701 2702 endif2703 enddo2704 enddo2705 enddo2689 !AC! do k=1,ntra 2690 !AC! do j=2,nl 2691 !AC! do il=1,ncum 2692 !AC! if (j.le.inb(il) .and. iflag(il) .le. 1) then 2693 !AC! 2694 !AC! if (cvflag_grav) then 2695 !AC! ftra(il,1,k)=ftra(il,1,k)+0.01*grav*work(il)*ment(il,j,1) 2696 !AC! : *(traent(il,j,1,k)-tra(il,1,k)) 2697 !AC! else 2698 !AC! ftra(il,1,k)=ftra(il,1,k)+0.1*work(il)*ment(il,j,1) 2699 !AC! : *(traent(il,j,1,k)-tra(il,1,k)) 2700 !AC! endif 2701 !AC! 2702 !AC! endif 2703 !AC! enddo 2704 !AC! enddo 2705 !AC! enddo 2706 2706 c print*,'cv3_yield apres ft' 2707 2707 c … … 2865 2865 1350 continue 2866 2866 2867 do k=1,ntra2868 do il=1,ncum2869 if (i.le.inb(il) .and. iflag(il) .le. 1) then2870 dpinv=1.0/(ph(il,i)-ph(il,i+1))2871 cpinv=1.0/cpn(il,i)2872 if (cvflag_grav) then2873 ftra(il,i,k)=ftra(il,i,k)+0.01*grav*dpinv2874 : *(amp1(il)*(tra(il,i+1,k)-tra(il,i,k))2875 : -ad(il)*(tra(il,i,k)-tra(il,i-1,k)))2876 else2877 ftra(il,i,k)=ftra(il,i,k)+0.1*dpinv2878 : *(amp1(il)*(tra(il,i+1,k)-tra(il,i,k))2879 : -ad(il)*(tra(il,i,k)-tra(il,i-1,k)))2880 endif2881 endif2882 enddo2883 enddo2867 !AC! do k=1,ntra 2868 !AC! do il=1,ncum 2869 !AC! if (i.le.inb(il) .and. iflag(il) .le. 1) then 2870 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 2871 !AC! cpinv=1.0/cpn(il,i) 2872 !AC! if (cvflag_grav) then 2873 !AC! ftra(il,i,k)=ftra(il,i,k)+0.01*grav*dpinv 2874 !AC! : *(amp1(il)*(tra(il,i+1,k)-tra(il,i,k)) 2875 !AC! : -ad(il)*(tra(il,i,k)-tra(il,i-1,k))) 2876 !AC! else 2877 !AC! ftra(il,i,k)=ftra(il,i,k)+0.1*dpinv 2878 !AC! : *(amp1(il)*(tra(il,i+1,k)-tra(il,i,k)) 2879 !AC! : -ad(il)*(tra(il,i,k)-tra(il,i-1,k))) 2880 !AC! endif 2881 !AC! endif 2882 !AC! enddo 2883 !AC! enddo 2884 2884 2885 2885 do 480 k=1,i-1 … … 2938 2938 480 continue 2939 2939 2940 do j=1,ntra2941 do k=1,i-12942 do il=1,ncum2943 if (i.le.inb(il) .and. iflag(il) .le. 1) then2944 dpinv=1.0/(ph(il,i)-ph(il,i+1))2945 cpinv=1.0/cpn(il,i)2946 if (cvflag_grav) then2947 ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv*ment(il,k,i)2948 : *(traent(il,k,i,j)-tra(il,i,j))2949 else2950 ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv*ment(il,k,i)2951 : *(traent(il,k,i,j)-tra(il,i,j))2952 endif2953 endif2954 enddo2955 enddo2956 enddo2940 !AC! do j=1,ntra 2941 !AC! do k=1,i-1 2942 !AC! do il=1,ncum 2943 !AC! if (i.le.inb(il) .and. iflag(il) .le. 1) then 2944 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 2945 !AC! cpinv=1.0/cpn(il,i) 2946 !AC! if (cvflag_grav) then 2947 !AC! ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv*ment(il,k,i) 2948 !AC! : *(traent(il,k,i,j)-tra(il,i,j)) 2949 !AC! else 2950 !AC! ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv*ment(il,k,i) 2951 !AC! : *(traent(il,k,i,j)-tra(il,i,j)) 2952 !AC! endif 2953 !AC! endif 2954 !AC! enddo 2955 !AC! enddo 2956 !AC! enddo 2957 2957 2958 2958 do 490 k=i,nl+1 … … 3004 3004 490 continue 3005 3005 3006 do j=1,ntra3007 do k=i,nl+13008 do il=1,ncum3009 if (i.le.inb(il) .and. k.le.inb(il)3010 $ .and. iflag(il) .le. 1) then3011 dpinv=1.0/(ph(il,i)-ph(il,i+1))3012 cpinv=1.0/cpn(il,i)3013 if (cvflag_grav) then3014 ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv*ment(il,k,i)3015 : *(traent(il,k,i,j)-tra(il,i,j))3016 else3017 ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv*ment(il,k,i)3018 : *(traent(il,k,i,j)-tra(il,i,j))3019 endif3020 endif ! i and k3021 enddo3022 enddo3023 enddo3006 !AC! do j=1,ntra 3007 !AC! do k=i,nl+1 3008 !AC! do il=1,ncum 3009 !AC! if (i.le.inb(il) .and. k.le.inb(il) 3010 !AC! $ .and. iflag(il) .le. 1) then 3011 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 3012 !AC! cpinv=1.0/cpn(il,i) 3013 !AC! if (cvflag_grav) then 3014 !AC! ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv*ment(il,k,i) 3015 !AC! : *(traent(il,k,i,j)-tra(il,i,j)) 3016 !AC! else 3017 !AC! ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv*ment(il,k,i) 3018 !AC! : *(traent(il,k,i,j)-tra(il,i,j)) 3019 !AC! endif 3020 !AC! endif ! i and k 3021 !AC! enddo 3022 !AC! enddo 3023 !AC! enddo 3024 3024 3025 3025 c sb: interface with the cloud parameterization: ! cld … … 3052 3052 enddo 3053 3053 3054 do j=1,ntra3055 do il=1,ncum3056 if (i.le.inb(il) .and. iflag(il) .le. 1) then3057 dpinv=1.0/(ph(il,i)-ph(il,i+1))3058 cpinv=1.0/cpn(il,i)3059 3060 if (cvflag_grav) then3061 ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv3062 : *(mp(il,i+1)*(trap(il,i+1,j)-tra(il,i,j))3063 : -mp(il,i)*(trap(il,i,j)-trap(il,i-1,j)))3064 else3065 ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv3066 : *(mp(il,i+1)*(trap(il,i+1,j)-tra(il,i,j))3067 : -mp(il,i)*(trap(il,i,j)-trap(il,i-1,j)))3068 endif3069 endif ! i3070 enddo3071 enddo3054 !AC! do j=1,ntra 3055 !AC! do il=1,ncum 3056 !AC! if (i.le.inb(il) .and. iflag(il) .le. 1) then 3057 !AC! dpinv=1.0/(ph(il,i)-ph(il,i+1)) 3058 !AC! cpinv=1.0/cpn(il,i) 3059 !AC! 3060 !AC! if (cvflag_grav) then 3061 !AC! ftra(il,i,j)=ftra(il,i,j)+0.01*grav*dpinv 3062 !AC! : *(mp(il,i+1)*(trap(il,i+1,j)-tra(il,i,j)) 3063 !AC! : -mp(il,i)*(trap(il,i,j)-trap(il,i-1,j))) 3064 !AC! else 3065 !AC! ftra(il,i,j)=ftra(il,i,j)+0.1*dpinv 3066 !AC! : *(mp(il,i+1)*(trap(il,i+1,j)-tra(il,i,j)) 3067 !AC! : -mp(il,i)*(trap(il,i,j)-trap(il,i-1,j))) 3068 !AC! endif 3069 !AC! endif ! i 3070 !AC! enddo 3071 !AC! enddo 3072 3072 3073 3073 … … 3146 3146 503 continue 3147 3147 3148 do j=1,ntra3149 do il=1,ncum3150 IF (iflag(il) .le. 1) THEN3151 IF (cvflag_grav) then3152 ex=0.01*grav*ment(il,inb(il),inb(il))3153 : *(traent(il,inb(il),inb(il),j)-tra(il,inb(il),j))3154 : /(ph(i l,inb(il))-ph(il,inb(il)+1))3155 ftra(il,inb(il),j)=ftra(il,inb(il),j)-ex3156 ftra(il,inb(il)-1,j)=ftra(il,inb(il)-1,j)3157 : +ex*(ph(il,inb(il))-ph(il,inb(il)+1))3158 : /(ph(il,inb(il)-1)-ph(il,inb(il)))3159 else3160 ex=0.1*ment(il,inb(il),inb(il))3161 : *(traent(il,inb(il),inb(il),j)-tra(il,inb(il),j))3162 : /(ph(i l,inb(il))-ph(il,inb(il)+1))3163 ftra(il,inb(il),j)=ftra(il,inb(il),j)-ex3164 ftra(il,inb(il)-1,j)=ftra(il,inb(il)-1,j)3165 : +ex*(ph(il,inb(il))-ph(il,inb(il)+1))3166 : /(ph(il,inb(il)-1)-ph(il,inb(il)))3167 ENDIF !cvflag grav3168 ENDIF !iflag3169 enddo3170 enddo3148 !AC! do j=1,ntra 3149 !AC! do il=1,ncum 3150 !AC! IF (iflag(il) .le. 1) THEN 3151 !AC! IF (cvflag_grav) then 3152 !AC! ex=0.01*grav*ment(il,inb(il),inb(il)) 3153 !AC! : *(traent(il,inb(il),inb(il),j)-tra(il,inb(il),j)) 3154 !AC! : /(ph(i l,inb(il))-ph(il,inb(il)+1)) 3155 !AC! ftra(il,inb(il),j)=ftra(il,inb(il),j)-ex 3156 !AC! ftra(il,inb(il)-1,j)=ftra(il,inb(il)-1,j) 3157 !AC! : +ex*(ph(il,inb(il))-ph(il,inb(il)+1)) 3158 !AC! : /(ph(il,inb(il)-1)-ph(il,inb(il))) 3159 !AC! else 3160 !AC! ex=0.1*ment(il,inb(il),inb(il)) 3161 !AC! : *(traent(il,inb(il),inb(il),j)-tra(il,inb(il),j)) 3162 !AC! : /(ph(i l,inb(il))-ph(il,inb(il)+1)) 3163 !AC! ftra(il,inb(il),j)=ftra(il,inb(il),j)-ex 3164 !AC! ftra(il,inb(il)-1,j)=ftra(il,inb(il)-1,j) 3165 !AC! : +ex*(ph(il,inb(il))-ph(il,inb(il)+1)) 3166 !AC! : /(ph(il,inb(il)-1)-ph(il,inb(il))) 3167 !AC! ENDIF !cvflag grav 3168 !AC! ENDIF !iflag 3169 !AC! enddo 3170 !AC! enddo 3171 3171 3172 3172 c … … 3287 3287 ENDDO 3288 3288 ENDDO 3289 DO j = 1,ntra 3290 DO i = 1,nl 3291 DO il = 1,ncum 3292 IF (iflag(il) .le. 1) THEN 3293 ftra(il,i,j) = ftra(il,i,j)/alpha_qpos(il) 3294 ENDIF 3295 ENDDO 3296 ENDDO 3297 ENDDO 3289 3290 !AC! DO j = 1,ntra 3291 !AC! DO i = 1,nl 3292 !AC! DO il = 1,ncum 3293 !AC! IF (iflag(il) .le. 1) THEN 3294 !AC! ftra(il,i,j) = ftra(il,i,j)/alpha_qpos(il) 3295 !AC! ENDIF 3296 !AC! ENDDO 3297 !AC! ENDDO 3298 !AC! ENDDO 3298 3299 3299 3300 c … … 3539 3540 end 3540 3541 3542 !AC! 3543 SUBROUTINE cv3_tracer(nloc,len,ncum,nd,na, 3544 & ment,sij,da,phi) 3545 implicit none 3546 c inputs: 3547 integer ncum, nd, na, nloc,len 3548 real ment(nloc,na,na),sij(nloc,na,na) 3549 c ouputs: 3550 real da(nloc,na),phi(nloc,na,na) 3551 c local variables: 3552 integer i,j,k 3553 c 3554 da(:,:)=0. 3555 c 3556 do j=1,na 3557 do k=1,na 3558 do i=1,ncum 3559 da(i,j)=da(i,j)+(1.-sij(i,k,j))*ment(i,k,j) 3560 phi(i,j,k)=sij(i,k,j)*ment(i,k,j) 3561 end do 3562 end do 3563 end do 3564 return 3565 end 3566 !AC! 3541 3567 3542 3568 SUBROUTINE cv3_uncompress(nloc,len,ncum,nd,ntra,idcum … … 3609 3635 3610 3636 3611 do 2100 j=1,ntra3612 c oct3 do 2110 k=1,nl3613 do 2110 k=1,nd ! oct33614 do 2120 i=1,ncum3615 ftra1(idcum(i),k,j)=ftra(i,k,j)3616 2120 continue3617 2110 continue3618 2100 continue3637 !AC! do 2100 j=1,ntra 3638 !AC!c oct3 do 2110 k=1,nl 3639 !AC! do 2110 k=1,nd ! oct3 3640 !AC! do 2120 i=1,ncum 3641 !AC! ftra1(idcum(i),k,j)=ftra(i,k,j) 3642 !AC! 2120 continue 3643 !AC! 2110 continue 3644 !AC! 2100 continue 3619 3645 return 3620 3646 end -
LMDZ5/branches/testing/libf/phylmd/cv3a_compress.F
r1403 r1669 116 116 110 continue 117 117 118 do 121 j=1,ntra119 ccccc do 111 k=1,nl+1120 do 111 k=1,nd121 nn=0122 do 101 i=1,len123 if(iflag1(i).eq.0)then124 nn=nn+1125 tra(nn,k,j)=tra1(i,k,j)126 endif127 101 continue128 111 continue129 121 continue118 !AC! do 121 j=1,ntra 119 !AC!ccccc do 111 k=1,nl+1 120 !AC! do 111 k=1,nd 121 !AC! nn=0 122 !AC! do 101 i=1,len 123 !AC! if(iflag1(i).eq.0)then 124 !AC! nn=nn+1 125 !AC! tra(nn,k,j)=tra1(i,k,j) 126 !AC! endif 127 !AC! 101 continue 128 !AC! 111 continue 129 !AC! 121 continue 130 130 131 131 if (nn.ne.ncum) then -
LMDZ5/branches/testing/libf/phylmd/cv3a_uncompress.F
r1518 r1669 9 9 : ,Plim1,Plim2,asupmax,supmax0 10 10 : ,asupmaxmin 11 !AC! 12 : ,da,phi 13 !AC! 11 14 o ,iflag1,kbas1,ktop1 12 15 : ,precip1,cbmf1,plcl1,plfc1,wbeff1,sig1,w01,ptop21 … … 17 20 : ,ftd1,fqd1 18 21 : ,Plim11,Plim21,asupmax1,supmax01 19 : ,asupmaxmin1 ) 22 : ,asupmaxmin1 23 !AC! 24 : ,da1,phi1 ) 25 !AC! 20 26 *************************************************************** 21 27 * * … … 50 56 real asupmax(nloc,nd),supmax0(nloc) 51 57 real asupmaxmin(nloc) 52 58 !AC! 59 real da(nloc,nd),phi(nloc,nd,nd) 60 !AC! 53 61 c outputs: 54 62 integer iflag1(len),kbas1(len),ktop1(len) … … 68 76 real asupmax1(len,nd),supmax01(len) 69 77 real asupmaxmin1(len) 78 !AC! 79 real da1(nloc,nd),phi1(nloc,nd,nd) 80 !AC! 70 81 c 71 82 c local variables: … … 111 122 fqd1(idcum(i),k)=fqd(i,k) 112 123 asupmax1(idcum(i),k)=asupmax(i,k) 113 2010 continue 124 !AC! 125 da1(idcum(i),k)=da(i,k) 126 !AC! 127 2010 continue 114 128 2020 continue 115 129 … … 119 133 120 134 121 do 2100 j=1,ntra 122 c oct3 do 2110 k=1,nl 123 do 2110 k=1,nd ! oct3 124 do 2120 i=1,ncum 125 ftra1(idcum(i),k,j)=ftra(i,k,j) 126 2120 continue 127 2110 continue 128 2100 continue 135 !AC! do 2100 j=1,ntra 136 !AC!c oct3 do 2110 k=1,nl 137 !AC! do 2110 k=1,nd ! oct3 138 !AC! do 2120 i=1,ncum 139 !AC! ftra1(idcum(i),k,j)=ftra(i,k,j) 140 !AC! 2120 continue 141 !AC! 2110 continue 142 !AC! 2100 continue 143 144 !AC! 145 do j=1,nd 146 do k=1,nd 147 do i=1,ncum 148 phi1(idcum(i),k,j)=phi(i,k,j) 149 end do 150 end do 151 end do 152 !AC! 153 129 154 c 130 155 c do 2220 k2=1,nd -
LMDZ5/branches/testing/libf/phylmd/cv3p_mixing.F
r1664 r1669 118 118 elij(i,k,j)=0.0 119 119 hent(i,k,j)=0.0 120 ment(i,k,j)=0.0121 sij(i,k,j)=0.0120 !AC! ment(i,k,j)=0.0 121 !AC! sij(i,k,j)=0.0 122 122 385 continue 123 123 390 continue 124 124 400 continue 125 126 !AC! 127 ment(1:ncum,1:nd,1:nd)=0.0 128 sij(1:ncum,1:nd,1:nd)=0.0 129 !AC! 125 130 126 131 do k=1,ntra -
LMDZ5/branches/testing/libf/phylmd/cva_driver.F
r1518 r1669 20 20 & ftd1,fqd1, 21 21 & Plim11,Plim21,asupmax1,supmax01,asupmaxmin1 22 & ,lalim_conv) 22 & ,lalim_conv, 23 !AC! 24 & da1,phi1) 25 !AC! 23 26 *************************************************************** 24 27 * * … … 171 174 real tvp1(len,nd) 172 175 c 176 !AC! 177 real da1(len,nd),phi1(len,nd,nd) 178 real da(len,nd),phi(len,nd,nd) 179 !AC! 173 180 real ftd1(len,nd) 174 181 real fqd1(len,nd) … … 912 919 endif 913 920 921 !AC! 922 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 923 ! --- passive tracers 924 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 925 926 if (iflag_con.eq.3) then 927 CALL cv3_tracer(nloc,len,ncum,nd,nd, 928 : ment,sij,da,phi) 929 endif 930 931 !AC! 932 914 933 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 915 934 ! --- UNCOMPRESS THE FIELDS … … 928 947 : ,Plim1,Plim2,asupmax,supmax0 929 948 : ,asupmaxmin 949 !AC! 950 : ,da,phi 951 !AC! 930 952 o ,iflag1,kbas1,ktop1 931 953 o ,precip1,cbmf1,plcl1,plfc1,wbeff1,sig1,w01,ptop21 … … 936 958 o ,ftd1,fqd1 937 959 o ,Plim11,Plim21,asupmax1,supmax01 938 o ,asupmaxmin1) 960 o ,asupmaxmin1 961 !AC! 962 o ,da1,phi1) 963 !AC! 939 964 endif 940 965 -
LMDZ5/branches/testing/libf/phylmd/inistats.F
r1492 r1669 18 18 real, dimension(istime) :: lt 19 19 integer :: nvarid 20 real, dimension(llm) :: pseudoalt21 20 22 21 write (*,*) -
LMDZ5/branches/testing/libf/phylmd/phys_output_mod.F90
r1665 r1669 33 33 CHARACTER(len=20), dimension(nfiles), private, save :: type_ecri 34 34 !$OMP THREADPRIVATE(nhorim, nvertm, zoutm,zdtime,type_ecri) 35 ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics 36 logical, save :: swaero_diag=.FALSE. 37 35 38 36 39 ! integer, save :: nid_hf3d … … 260 263 type(ctrl_out),save :: o_wape = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wape') 261 264 265 !!! nrlmd le 10/04/2012 266 267 !-------Spectre de thermiques de type 2 au LCL 268 type(ctrl_out),save :: o_n2 = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'n2') 269 type(ctrl_out),save :: o_s2 = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'s2') 270 271 !-------Déclenchement stochastique 272 type(ctrl_out),save :: o_proba_notrig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'proba_notrig') 273 type(ctrl_out),save :: o_random_notrig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'random_notrig') 274 type(ctrl_out),save :: o_ale_bl_stat = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_stat') 275 type(ctrl_out),save :: o_ale_bl_trig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_trig') 276 277 !-------Fermeture statistique 278 type(ctrl_out),save :: o_alp_bl_det = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_det') 279 type(ctrl_out),save :: o_alp_bl_fluct_m = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_m') 280 type(ctrl_out),save :: o_alp_bl_fluct_tke = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_tke') 281 type(ctrl_out),save :: o_alp_bl_conv = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_conv') 282 type(ctrl_out),save :: o_alp_bl_stat = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_stat') 283 284 !!! fin nrlmd le 10/04/2012 262 285 263 286 ! Champs interpolles sur des niveaux de pression ??? a faire correctement … … 365 388 366 389 type(ctrl_out),save :: o_topswad = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad') 390 type(ctrl_out),save :: o_topswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad0') 367 391 type(ctrl_out),save :: o_topswai = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswai') 368 392 type(ctrl_out),save :: o_solswad = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad') 393 type(ctrl_out),save :: o_solswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad0') 369 394 type(ctrl_out),save :: o_solswai = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswai') 370 395 … … 432 457 type(ctrl_out),save :: o_ovap = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'ovap') 433 458 type(ctrl_out),save :: o_ovapinit = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ovapinit') 459 type(ctrl_out),save :: o_oliq = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'oliq') 434 460 type(ctrl_out),save :: o_wvapp = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'wvapp') 435 461 type(ctrl_out),save :: o_geop = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'geop') … … 494 520 type(ctrl_out),save :: o_dtcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtcon') 495 521 type(ctrl_out),save :: o_ducon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ducon') 522 type(ctrl_out),save :: o_dvcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvcon') 496 523 type(ctrl_out),save :: o_dqcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqcon') 497 524 type(ctrl_out),save :: o_dtwak = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dtwak') … … 531 558 type(ctrl_out),save :: o_e_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'e_th') 532 559 type(ctrl_out),save :: o_w_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'w_th') 533 type(ctrl_out),save :: o_lambda_th = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'lambda_th')534 560 type(ctrl_out),save :: o_ftime_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_th') 535 561 type(ctrl_out),save :: o_q_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'q_th') … … 537 563 type(ctrl_out),save :: o_d_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'d_th') 538 564 type(ctrl_out),save :: o_f0_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f0_th') 539 type(ctrl_out),save :: o_zmax_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'zmax_th')565 type(ctrl_out),save :: o_zmax_th = ctrl_out((/ 4, 4, 4, 5, 10, 10 /),'zmax_th') 540 566 type(ctrl_out),save :: o_dqthe = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqthe') 541 567 type(ctrl_out),save :: o_dtajs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtajs') … … 621 647 USE infotrac 622 648 USE ioipsl 649 ! USE phys_cal_mod, only : hour 623 650 USE mod_phys_lmdz_para 624 651 USE aero_mod, only : naero_spc,name_aero … … 682 709 ! entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax] 683 710 684 logical, dimension(nfiles), save :: phys_out_regfkey = (/ .false., .false., .false., .false., .false., .false. /)685 real, dimension(nfiles), save :: phys_out_lonmin = (/ -180., -180., -180., -180., -180.,-180. /)686 real, dimension(nfiles), save :: phys_out_lonmax = (/ 180., 180., 180., 180., 180.,180. /)687 real, dimension(nfiles), save :: phys_out_latmin = (/ -90., -90., -90., -90., -90.,-90. /)688 real, dimension(nfiles), save :: phys_out_latmax = (/ 90., 90., 90., 90., 90.,90. /)711 logical, dimension(nfiles), save :: phys_out_regfkey = (/ .false., .false., .false., .false., .false., .false. /) 712 real, dimension(nfiles), save :: phys_out_lonmin = (/ -180., -180., -180., -180., -180., -180. /) 713 real, dimension(nfiles), save :: phys_out_lonmax = (/ 180., 180., 180., 180., 180., 180. /) 714 real, dimension(nfiles), save :: phys_out_latmin = (/ -90., -90., -90., -90., -90., -90. /) 715 real, dimension(nfiles), save :: phys_out_latmax = (/ 90., 90., 90., 90., 90., 90. /) 689 716 690 717 write(lunout,*) 'Debut phys_output_mod.F90' … … 792 819 DO iff=1,nfiles 793 820 821 ! Calculate ecrit_files for all files 822 if ( chtimestep(iff).eq.'DefFreq' ) then 823 ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf ...)*86400. 824 ecrit_files(iff)=ecrit_files(iff)*86400. 825 else 826 call convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) 827 endif 828 write(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff) 829 830 zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde 831 794 832 IF (clef_files(iff)) THEN 795 833 796 if ( chtimestep(iff).eq.'DefFreq' ) then797 ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf ...)*86400.798 ecrit_files(iff)=ecrit_files(iff)*86400.799 else800 call convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff))801 endif802 write(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff)803 804 zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde805 806 834 idayref = day_ref 807 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) 835 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) 836 ! correction pour l heure initiale !jyg 837 ! !jyg 838 ! CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian) !jyg 808 839 809 840 !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !! … … 1099 1130 o_topswad%flag,o_topswad%name, "ADE at TOA", "W/m2") 1100 1131 CALL histdef2d(iff,clef_stations(iff), & 1132 o_topswad0%flag,o_topswad0%name, "ADE clear-sky at TOA", "W/m2") 1133 CALL histdef2d(iff,clef_stations(iff), & 1101 1134 o_solswad%flag,o_solswad%name, "ADE at SRF", "W/m2") 1135 CALL histdef2d(iff,clef_stations(iff), & 1136 o_solswad0%flag,o_solswad0%name, "ADE clear-sky at SRF", "W/m2") 1102 1137 1103 1138 CALL histdef2d(iff,clef_stations(iff), & … … 1216 1251 o_wbeff%flag,o_wbeff%name, "Conv. updraft velocity at LFC (<100)", "m/s") 1217 1252 end if 1218 CALL histdef2d(iff,clef_stations(iff), &1219 o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")1220 1253 IF (.NOT.clef_stations(iff)) THEN 1221 1254 ! … … 1253 1286 ENDIF !iflag_con .GE. 3 1254 1287 1288 CALL histdef2d(iff,clef_stations(iff), & 1289 o_prw%flag,o_prw%name, "Precipitable water", "kg/m2") 1255 1290 CALL histdef2d(iff,clef_stations(iff), & 1256 1291 o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m") … … 1318 1353 ! Couplage conv-CL 1319 1354 IF (iflag_con.GE.3) THEN 1355 IF (iflag_coupl>=1) THEN 1320 1356 CALL histdef2d(iff,clef_stations(iff), & 1321 1357 o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2") 1322 1358 CALL histdef2d(iff,clef_stations(iff), & 1323 1359 o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2") 1360 ENDIF 1324 1361 ENDIF !(iflag_con.GE.3) 1325 1362 … … 1375 1412 CALL histdef3d(iff,clef_stations(iff),o_theta%flag,o_theta%name, "Potential air temperature", "K" ) 1376 1413 CALL histdef3d(iff,clef_stations(iff),o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" ) 1414 CALL histdef3d(iff,clef_stations(iff),o_oliq%flag,o_oliq%name, "Condensed water", "kg/kg" ) 1377 1415 CALL histdef3d(iff,clef_stations(iff), & 1378 1416 o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" ) … … 1480 1518 o_ducon%flag,o_ducon%name, "Convection du", "m/s2") 1481 1519 CALL histdef3d(iff,clef_stations(iff), & 1520 o_dvcon%flag,o_dvcon%name, "Convection dv", "m/s2") 1521 CALL histdef3d(iff,clef_stations(iff), & 1482 1522 o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s") 1483 1523 … … 1489 1529 CALL histdef2d(iff,clef_stations(iff), & 1490 1530 o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2") 1531 CALL histdef2d(iff,clef_stations(iff), & 1532 o_ale%flag,o_ale%name, "ALE", "m2/s2") 1533 CALL histdef2d(iff,clef_stations(iff), & 1534 o_alp%flag,o_alp%name, "ALP", "W/m2") 1535 CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2") 1536 CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2") 1491 1537 CALL histdef2d(iff,clef_stations(iff),o_wake_h%flag,o_wake_h%name, "wake_h", "-") 1492 1538 CALL histdef2d(iff,clef_stations(iff),o_wake_s%flag,o_wake_s%name, "wake_s", "-") … … 1496 1542 CALL histdef3d(iff,clef_stations(iff),o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ") 1497 1543 CALL histdef3d(iff,clef_stations(iff),o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ") 1498 CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")1499 1544 ENDIF 1500 CALL histdef2d(iff,clef_stations(iff), &1501 o_ale%flag,o_ale%name, "ALE", "m2/s2")1502 CALL histdef2d(iff,clef_stations(iff), &1503 o_alp%flag,o_alp%name, "ALP", "W/m2")1504 CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")1505 1545 CALL histdef3d(iff,clef_stations(iff),o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-") 1506 1546 CALL histdef3d(iff,clef_stations(iff),o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-") 1507 1547 CALL histdef3d(iff,clef_stations(iff),o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-") 1508 1548 ENDIF !(iflag_con.EQ.3) 1549 1550 !!! nrlmd le 10/04/2012 1551 1552 IF (iflag_trig_bl>=1) THEN 1553 CALL histdef2d(iff,clef_stations(iff),o_n2%flag,o_n2%name, "Nombre de panaches de type 2", " ") 1554 CALL histdef2d(iff,clef_stations(iff),o_s2%flag,o_s2%name, "Surface moyenne des panaches de type 2", "m2") 1555 1556 CALL histdef2d(iff,clef_stations(iff),o_proba_notrig%flag,o_proba_notrig%name, "Probabilité de non-déclenchement", " ") 1557 CALL histdef2d(iff,clef_stations(iff),o_random_notrig%flag,o_random_notrig%name, "Tirage aléatoire de non-déclenchement", " ") 1558 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_trig%flag,o_ale_bl_trig%name, "ALE_BL_STAT + Condition P>Pseuil", "m2/s2") 1559 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_stat%flag,o_ale_bl_stat%name, "ALE_BL_STAT", "m2/s2") 1560 ENDIF !(iflag_trig_bl>=1) 1561 1562 IF (iflag_clos_bl>=1) THEN 1563 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_det%flag,o_alp_bl_det%name, "ALP_BL_DET", "W/m2") 1564 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_m%flag,o_alp_bl_fluct_m%name, "ALP_BL_FLUCT_M", "W/m2") 1565 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_tke%flag,o_alp_bl_fluct_tke%name, "ALP_BL_FLUCT_TKE", "W/m2") 1566 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_conv%flag,o_alp_bl_conv%name, "ALP_BL_CONV", "W/m2") 1567 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_stat%flag,o_alp_bl_stat%name, "ALP_BL_STAT", "W/m2") 1568 ENDIF !(iflag_clos_bl>=1) 1569 1570 !!! fin nrlmd le 10/04/2012 1509 1571 1510 1572 CALL histdef3d(iff,clef_stations(iff),o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s") … … 1519 1581 CALL histdef3d(iff,clef_stations(iff),o_dtthe%flag,o_dtthe%name, "Thermal dT", "K/s") 1520 1582 1521 if(iflag_thermals.g t.1) THEN1583 if(iflag_thermals.ge.1) THEN 1522 1584 CALL histdef3d(iff,clef_stations(iff),o_dqlscth%flag,o_dqlscth%name, "dQ therm.", "(kg/kg)/s") 1523 1585 CALL histdef3d(iff,clef_stations(iff),o_dqlscst%flag,o_dqlscst%name, "dQ strat.", "(kg/kg)/s") … … 1531 1593 CALL histdef3d(iff,clef_stations(iff),o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s") 1532 1594 CALL histdef3d(iff,clef_stations(iff),o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s") 1533 CALL histdef3d(iff,clef_stations(iff), &1534 o_lambda_th%flag,o_lambda_th%name,"Thermal plume vertical velocity","m/s")1535 1595 CALL histdef2d(iff,clef_stations(iff), & 1536 1596 o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ") … … 1548 1608 CALL histdef3d(iff,clef_stations(iff), & 1549 1609 o_dqthe%flag,o_dqthe%name, "Thermal dQ", "(kg/kg)/s") 1550 endif !iflag_thermals.g t.11610 endif !iflag_thermals.ge.1 1551 1611 CALL histdef3d(iff,clef_stations(iff), & 1552 1612 o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s") … … 1708 1768 1709 1769 ENDDO ! iff 1770 1771 ! Updated write frequencies due to phys_out_filetimesteps. 1772 ! Write frequencies are now in seconds. 1773 ecrit_mth = ecrit_files(1) 1774 ecrit_day = ecrit_files(2) 1775 ecrit_hf = ecrit_files(3) 1776 ecrit_ins = ecrit_files(4) 1777 ecrit_LES = ecrit_files(5) 1778 ecrit_ins = ecrit_files(6) 1779 1780 write(lunout,*)'swaero_diag=',swaero_diag 1710 1781 write(lunout,*)'Fin phys_output_mod.F90' 1711 1782 end subroutine phys_output_open … … 1756 1827 endif 1757 1828 endif 1829 1830 ! Set swaero_diag=true if at least one of the concerned variables are defined 1831 if (nomvar=='topswad' .OR. nomvar=='topswai' .OR. nomvar=='solswad' .OR. nomvar=='solswai' ) THEN 1832 if ( flag_var(iff)<=lev_files(iff) ) then 1833 swaero_diag=.TRUE. 1834 end if 1835 end if 1758 1836 end subroutine histdef2d 1759 1837 -
LMDZ5/branches/testing/libf/phylmd/phys_output_write.h
r1665 r1669 508 508 ENDIF 509 509 510 if (iflag_pbl>1 .and. lev_ histday.gt.10 ) then510 if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then 511 511 IF (o_tke_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN 512 512 CALL histwrite_phy(nid_files(iff),clef_stations(iff), … … 631 631 end if 632 632 633 IF (o_prw%flag(iff)<=lev_files(iff)) THEN634 CALL histwrite_phy(nid_files(iff),clef_stations(iff),635 $o_prw%name,itau_w,prw)636 ENDIF637 638 633 IF (.NOT.clef_stations(iff)) THEN 639 634 IF (o_cape_max%flag(iff)<=lev_files(iff)) THEN … … 671 666 672 667 IF (o_mc%flag(iff)<=lev_files(iff)) THEN 673 if(iflag_thermals .gt.1)then668 if(iflag_thermals>=1)then 674 669 zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev) 675 670 else … … 681 676 682 677 ENDIF !iflag_con .GE. 3 678 679 IF (o_prw%flag(iff)<=lev_files(iff)) THEN 680 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 681 $o_prw%name,itau_w,prw) 682 ENDIF 683 683 684 684 IF (o_s_pblh%flag(iff)<=lev_files(iff)) THEN … … 801 801 ! Couplage convection-couche limite 802 802 IF (iflag_con.GE.3) THEN 803 IF (iflag_coupl>=1) THEN 803 804 IF (o_ale_bl%flag(iff)<=lev_files(iff)) THEN 804 805 CALL histwrite_phy(nid_files(iff),clef_stations(iff), … … 809 810 $o_alp_bl%name,itau_w,alp_bl) 810 811 ENDIF 812 ENDIF !iflag_coupl>=1 811 813 ENDIF !(iflag_con.GE.3) 812 814 … … 823 825 ENDIF 824 826 827 IF (o_ale%flag(iff)<=lev_files(iff)) THEN 828 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 829 $o_ale%name,itau_w,ale) 830 ENDIF 831 IF (o_alp%flag(iff)<=lev_files(iff)) THEN 832 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 833 $o_alp%name,itau_w,alp) 834 ENDIF 835 IF (o_cin%flag(iff)<=lev_files(iff)) THEN 836 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 837 $o_cin%name,itau_w,cin) 838 ENDIF 825 839 IF (o_wape%flag(iff)<=lev_files(iff)) THEN 826 840 CALL histwrite_phy(nid_files(iff),clef_stations(iff), … … 869 883 ENDIF ! iflag_wake>=1 870 884 871 IF (o_ale%flag(iff)<=lev_files(iff)) THEN872 CALL histwrite_phy(nid_files(iff),clef_stations(iff),873 $o_ale%name,itau_w,ale)874 ENDIF875 IF (o_alp%flag(iff)<=lev_files(iff)) THEN876 CALL histwrite_phy(nid_files(iff),clef_stations(iff),877 $o_alp%name,itau_w,alp)878 ENDIF879 IF (o_cin%flag(iff)<=lev_files(iff)) THEN880 CALL histwrite_phy(nid_files(iff),clef_stations(iff),881 $o_cin%name,itau_w,cin)882 ENDIF883 885 IF (o_Vprecip%flag(iff)<=lev_files(iff)) THEN 884 886 CALL histwrite_phy(nid_files(iff),clef_stations(iff), … … 897 899 ENDIF !(iflag_con.EQ.3) 898 900 901 !!! nrlmd le 10/04/2012 902 903 IF (iflag_trig_bl>=1) THEN 904 IF (o_n2%flag(iff)<=lev_files(iff)) THEN 905 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 906 s o_n2%name,itau_w,n2) 907 ENDIF 908 909 IF (o_s2%flag(iff)<=lev_files(iff)) THEN 910 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 911 s o_s2%name,itau_w,s2) 912 ENDIF 913 914 IF (o_proba_notrig%flag(iff)<=lev_files(iff)) THEN 915 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 916 s o_proba_notrig%name,itau_w,proba_notrig) 917 ENDIF 918 919 IF (o_random_notrig%flag(iff)<=lev_files(iff)) THEN 920 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 921 s o_random_notrig%name,itau_w,random_notrig) 922 ENDIF 923 924 IF (o_ale_bl_stat%flag(iff)<=lev_files(iff)) THEN 925 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 926 s o_ale_bl_stat%name,itau_w,ale_bl_stat) 927 ENDIF 928 929 IF (o_ale_bl_trig%flag(iff)<=lev_files(iff)) THEN 930 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 931 s o_ale_bl_trig%name,itau_w,ale_bl_trig) 932 ENDIF 933 ENDIF !(iflag_trig_bl>=1) 934 935 IF (iflag_clos_bl>=1) THEN 936 IF (o_alp_bl_det%flag(iff)<=lev_files(iff)) THEN 937 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 938 s o_alp_bl_det%name,itau_w,alp_bl_det) 939 ENDIF 940 941 IF (o_alp_bl_fluct_m%flag(iff)<=lev_files(iff)) THEN 942 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 943 s o_alp_bl_fluct_m%name,itau_w,alp_bl_fluct_m) 944 ENDIF 945 946 IF (o_alp_bl_fluct_tke%flag(iff)<=lev_files(iff)) THEN 947 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 948 s o_alp_bl_fluct_tke%name,itau_w,alp_bl_fluct_tke) 949 ENDIF 950 951 IF (o_alp_bl_conv%flag(iff)<=lev_files(iff)) THEN 952 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 953 s o_alp_bl_conv%name,itau_w,alp_bl_conv) 954 ENDIF 955 956 IF (o_alp_bl_stat%flag(iff)<=lev_files(iff)) THEN 957 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 958 s o_alp_bl_stat%name,itau_w,alp_bl_stat) 959 ENDIF 960 ENDIF !(iflag_clos_bl>=1) 961 962 !!! fin nrlmd le 10/04/2012 963 899 964 IF (type_ocean=='slab ') THEN 900 965 IF ( o_slab_bils%flag(iff)<=lev_files(iff)) … … 1193 1258 $ topswad_aero) 1194 1259 ENDIF 1260 IF (o_topswad0%flag(iff)<=lev_files(iff)) THEN 1261 CALL histwrite_phy(nid_files(iff), 1262 $clef_stations(iff), 1263 $o_topswad0%name,itau_w, 1264 $ topswad0_aero) 1265 ENDIF 1195 1266 IF (o_solswad%flag(iff)<=lev_files(iff)) THEN 1196 1267 CALL histwrite_phy(nid_files(iff), … … 1198 1269 $o_solswad%name,itau_w, 1199 1270 $ solswad_aero) 1271 ENDIF 1272 IF (o_solswad0%flag(iff)<=lev_files(iff)) THEN 1273 CALL histwrite_phy(nid_files(iff), 1274 $clef_stations(iff), 1275 $o_solswad0%name,itau_w, 1276 $ solswad0_aero) 1200 1277 ENDIF 1201 1278 … … 1410 1487 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 1411 1488 $ o_ovap%name,itau_w,q_seri) 1489 ENDIF 1490 1491 IF (o_oliq%flag(iff)<=lev_files(iff)) THEN 1492 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 1493 $ o_oliq%name,itau_w,ql_seri) 1412 1494 ENDIF 1413 1495 … … 1637 1719 ENDIF 1638 1720 1721 IF (o_dvcon%flag(iff)<=lev_files(iff)) THEN 1722 zx_tmp_fi3d(1:klon,1:klev)=d_v_con(1:klon,1:klev)/pdtphys 1723 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 1724 $o_dvcon%name,itau_w,zx_tmp_fi3d) 1725 ENDIF 1726 1639 1727 IF (o_dqcon%flag(iff)<=lev_files(iff)) THEN 1640 1728 zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys … … 1680 1768 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1681 1769 ! Sorties specifiques a la separation thermiques/non thermiques 1682 if (iflag_thermals> 1) then1770 if (iflag_thermals>=1) then 1683 1771 1684 1772 IF (o_dtlscth%flag(iff)<=lev_files(iff)) THEN … … 1744 1832 ENDIF 1745 1833 1746 endif ! iflag_thermals> 11834 endif ! iflag_thermals>=1 1747 1835 1748 1836 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 1791 1879 ENDIF 1792 1880 1793 IF (iflag_thermals .gt.1) THEN1881 IF (iflag_thermals>=1) THEN 1794 1882 IF (o_ftime_th%flag(iff)<=lev_files(iff)) THEN 1795 1883 ! Pour l instant 0 a y reflichir pour les thermiques … … 1820 1908 ENDIF 1821 1909 1822 IF (o_lambda_th%flag(iff)<=lev_files(iff)) THEN1823 CALL histwrite_phy(nid_files(iff),clef_stations(iff),1824 s o_lambda_th%name,itau_w,lambda_th)1825 ENDIF1826 1910 1827 1911 IF (o_a_th%flag(iff)<=lev_files(iff)) THEN … … 2051 2135 ENDIF 2052 2136 2053 IF (o_mcd%flag(iff)<=lev_files(iff)) THEN 2054 zx_tmp_fi3d(1:klon,1:klev)=-1 * (dnwd(1:klon,1:klev)+ 2055 $ dnwd0(1:klon,1:klev)) 2056 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 2057 $o_mcd%name,itau_w,zx_tmp_fi3d) 2058 ENDIF 2059 2060 IF (o_dmc%flag(iff)<=lev_files(iff)) THEN 2061 zx_tmp_fi3d(1:klon,1:klev)=upwd(1:klon,1:klev) + 2062 $ dnwd(1:klon,1:klev)+ dnwd0(1:klon,1:klev) 2063 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 2064 $o_dmc%name,itau_w,zx_tmp_fi3d) 2065 ENDIF 2137 if (iflag_con >= 3) then 2138 IF (o_mcd%flag(iff)<=lev_files(iff)) THEN 2139 zx_tmp_fi3d(1:klon,1:klev)=-1 * (dnwd(1:klon,1:klev)+ 2140 $ dnwd0(1:klon,1:klev)) 2141 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 2142 $ o_mcd%name,itau_w,zx_tmp_fi3d) 2143 ENDIF 2144 2145 IF (o_dmc%flag(iff)<=lev_files(iff)) THEN 2146 zx_tmp_fi3d(1:klon,1:klev)=upwd(1:klon,1:klev) + 2147 $ dnwd(1:klon,1:klev)+ dnwd0(1:klon,1:klev) 2148 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 2149 $ o_dmc%name,itau_w,zx_tmp_fi3d) 2150 ENDIF 2151 else if (iflag_con == 2) then 2152 IF (o_mcd%flag(iff) <= lev_files(iff)) THEN 2153 CALL histwrite_phy(nid_files(iff), clef_stations(iff), 2154 $ o_mcd%name, itau_w, pmfd) 2155 ENDIF 2156 2157 IF (o_dmc%flag(iff) <= lev_files(iff)) THEN 2158 CALL histwrite_phy(nid_files(iff), clef_stations(iff), 2159 $ o_dmc%name, itau_w, pmfu + pmfd) 2160 ENDIF 2161 end if 2066 2162 2067 2163 IF (o_ref_liq%flag(iff)<=lev_files(iff)) THEN -
LMDZ5/branches/testing/libf/phylmd/phys_state_var_mod.F90
r1539 r1669 346 346 !$OMP THREADPRIVATE(ccm) 347 347 348 !!! nrlmd le 10/04/2012 349 REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:) 350 !$OMP THREADPRIVATE(ale_bl_trig) 351 !!! fin nrlmd le 10/04/2012 352 348 353 CONTAINS 349 354 … … 496 501 ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands)) 497 502 ALLOCATE(ccm(klon,klev,nbands)) 503 504 !!! nrlmd le 10/04/2012 505 ALLOCATE(ale_bl_trig(klon)) 506 !!! fin nrlmd le 10/04/2012 498 507 499 508 END SUBROUTINE phys_state_var_init … … 603 612 deallocate(ccm) 604 613 614 !!! nrlmd le 10/04/2012 615 deallocate(ale_bl_trig) 616 !!! fin nrlmd le 10/04/2012 617 605 618 END SUBROUTINE phys_state_var_end 606 619 -
LMDZ5/branches/testing/libf/phylmd/physiq.F
r1665 r1669 180 180 real facteur,zfratqs1,zfratqs2 181 181 182 REAL lambda_th(klon,klev),zz,znum,zden182 REAL zz,znum,zden 183 183 REAL wmax_th(klon) 184 184 REAL zmax_th(klon) … … 614 614 REAL dd_t(klon,klev),dd_q(klon,klev) 615 615 616 real, save :: alp_bl_prescr=0. 1617 real, save :: ale_bl_prescr= 4.616 real, save :: alp_bl_prescr=0. 617 real, save :: ale_bl_prescr=0. 618 618 619 619 real, save :: ale_max=1000. … … 689 689 REAL ztla(klon,klev) 690 690 REAL zthl(klon,klev) 691 692 ccc nrlmd le 10/04/2012 693 694 c--------Stochastic Boundary Layer Triggering: ALE_BL-------- 695 c---Propriétés du thermiques au LCL 696 real zlcl_th(klon) ! Altitude du LCL calculé continument (pcon dans thermcell_main.F90) 697 real fraca0(klon) ! Fraction des thermiques au LCL 698 real w0(klon) ! Vitesse des thermiques au LCL 699 real w_conv(klon) ! Vitesse verticale de grande échelle au LCL 700 real therm_tke_max0(klon) ! TKE dans les thermiques au LCL 701 real env_tke_max0(klon) ! TKE dans l'environnement au LCL 702 703 c---Spectre de thermiques de type 2 au LCL 704 real n2(klon),s2(klon) 705 real ale_bl_stat(klon) 706 707 c---Déclenchement stochastique 708 integer :: tau_trig(klon) 709 real proba_notrig(klon) 710 real random_notrig(klon) 711 712 c--------Statistical Boundary Layer Closure: ALP_BL-------- 713 c---Profils de TKE dans et hors du thermique 714 real pbl_tke_input(klon,klev+1,nbsrf) 715 real therm_tke_max(klon,klev) ! Profil de TKE dans les thermiques 716 real env_tke_max(klon,klev) ! Profil de TKE dans l'environnement 717 718 c---Fermeture statistique 719 real alp_bl_det(klon) ! ALP déterministe du thermique unique 720 real alp_bl_fluct_m(klon) ! ALP liée aux fluctuations de flux de masse sous-nuageux 721 real alp_bl_fluct_tke(klon) ! ALP liée aux fluctuations d'énergie cinétique sous-nuageuse 722 real alp_bl_conv(klon) ! ALP liée à grande échelle 723 real alp_bl_stat(klon) ! ALP totale 724 725 ccc fin nrlmd le 10/04/2012 691 726 692 727 c Variables locales pour la couche limite (al1): … … 1212 1247 LOGICAL, SAVE :: mskocean_beta 1213 1248 c$OMP THREADPRIVATE(mskocean_beta) 1214 REAL, dimension(klon, klev) :: beta ! facteur sur cldtaurad et cldemirad pour evaluer les retros liees aux CRF 1215 REAL, dimension(klon, klev) :: cldtaurad ! epaisseur optique pour radlwsw,COSP 1216 REAL, dimension(klon, klev) :: cldemirad ! emissivite pour radlwsw,COSP 1249 REAL, dimension(klon, klev) :: beta ! facteur sur cldtaurad et cldemirad pour evaluer les retros liees aux CRF 1250 REAL, dimension(klon, klev) :: cldtaurad ! epaisseur optique pour radlwsw,COSP 1251 REAL, dimension(klon, klev) :: cldtaupirad ! epaisseur optique pour radlwsw,COSP cas pre-industrial 1252 REAL, dimension(klon, klev) :: cldemirad ! emissivite pour radlwsw,COSP 1217 1253 INTEGER :: nbtr_tmp ! Number of tracer inside concvl 1218 1254 REAL, dimension(klon,klev) :: sh_in ! Specific humidity entering in phytrac … … 1354 1390 solswad(:)=0. 1355 1391 1356 lambda_th(:,:)=0.1357 1392 wmax_th(:)=0. 1358 1393 tau_overturning_th(:)=0. … … 1490 1525 cCR:04.12.07: initialisations poches froides 1491 1526 c Controle de ALE et ALP pour la fermeture convective (jyg) 1492 CALL ini_wake(0.,0.,it_wape_prescr,wape_prescr,fip_prescr 1527 if (iflag_wake>=1) then 1528 CALL ini_wake(0.,0.,it_wape_prescr,wape_prescr,fip_prescr 1493 1529 s ,alp_bl_prescr, ale_bl_prescr) 1494 1530 c 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU) 1495 1531 c print*,'apres ini_wake iflag_cldcon=', iflag_cldcon 1532 endif 1496 1533 1497 1534 do i = 1,klon … … 1516 1553 print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP 1517 1554 ENDIF 1555 1518 1556 c 1519 1557 ALLOCATE(tabCFMIP(nCFMIP)) … … 1624 1662 1625 1663 #endif 1626 1627 1628 ecrit_hf = ecrit_hf * un_jour1629 cIM1630 IF(ecrit_day.LE.1.) THEN1631 ecrit_day = ecrit_day * un_jour !en secondes1632 ENDIF1633 cIM1634 ecrit_mth = ecrit_mth * un_jour1635 ecrit_ins = ecrit_ins * un_jour1636 1664 ecrit_reg = ecrit_reg * un_jour 1637 1665 ecrit_tra = ecrit_tra * un_jour 1638 ecrit_LES = ecrit_LES * un_jour 1639 c 1640 1666 1641 1667 cXXXPB Positionner date0 pour initialisation de ORCHIDEE 1642 1668 date0 = jD_ref … … 1735 1761 ! 1736 1762 itap = itap + 1 1763 c 1737 1764 ! 1738 1765 ! Update fraction of the sub-surfaces (pctsrf) and … … 2042 2069 c 2043 2070 2044 if (iflag_pbl/=0) then 2045 2046 2047 e 2048 e 2049 e 2050 e 2051 e 2052 e 2053 + 2054 s 2055 s 2056 s 2057 s 2058 s 2059 d 2060 d 2061 d 2062 d 2063 d 2064 d 2065 d 2066 d 2067 - 2068 - 2071 if (iflag_pbl/=0) then 2072 2073 CALL pbl_surface( 2074 e dtime, date0, itap, days_elapsed+1, 2075 e debut, lafin, 2076 e rlon, rlat, rugoro, rmu0, 2077 e rain_fall, snow_fall, solsw, sollw, 2078 e t_seri, q_seri, u_seri, v_seri, 2079 e pplay, paprs, pctsrf, 2080 + ftsol, falb1, falb2, u10m, v10m, 2081 s sollwdown, cdragh, cdragm, u1, v1, 2082 s albsol1, albsol2, sens, evap, 2083 s zxtsol, zxfluxlat, zt2m, qsat2m, 2084 s d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, 2085 s coefh, coefm, slab_wfbils, 2086 d qsol, zq2m, s_pblh, s_lcl, 2087 d s_capCL, s_oliqCL, s_cteiCL,s_pblT, 2088 d s_therm, s_trmb1, s_trmb2, s_trmb3, 2089 d zxrugs, zu10m, zv10m, fder, 2090 d zxqsurf, rh2m, zxfluxu, zxfluxv, 2091 d frugs, agesno, fsollw, fsolsw, 2092 d d_ts, fevap, fluxlat, t2m, 2093 d wfbils, wfbilo, fluxt, fluxu, fluxv, 2094 - dsens, devap, zxsnow, 2095 - zxfluxt, zxfluxq, q2m, fluxq, pbl_tke ) 2069 2096 2070 2097 2071 2098 !----------------------------------------------------------------------------------------- 2072 2099 ! ajout des tendances de la diffusion turbulente 2073 2100 CALL add_phys_tend(d_u_vdf,d_v_vdf,d_t_vdf,d_q_vdf,dql0,'vdf') 2074 2101 !----------------------------------------------------------------------------------------- 2075 2102 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2103 if (mydebug) then 2104 call writefield_phy('u_seri',u_seri,llm) 2105 call writefield_phy('v_seri',v_seri,llm) 2106 call writefield_phy('t_seri',t_seri,llm) 2107 call writefield_phy('q_seri',q_seri,llm) 2108 endif 2109 2110 2111 IF (ip_ebil_phy.ge.2) THEN 2112 ztit='after surface_main' 2113 CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime 2087 2114 e , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay 2088 2115 s , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 2089 2116 call diagphy(airephy,ztit,ip_ebil_phy 2090 2117 e , zero_v, zero_v, zero_v, zero_v, sens 2091 2118 e , evap , zero_v, zero_v, ztsol 2092 2119 e , d_h_vcol, d_qt, d_ec 2093 2120 s , fs_bound, fq_bound ) 2094 2121 END IF 2095 2122 2096 2123 ENDIF 2097 2098 2124 c =================================================================== c 2099 2125 c Calcul de Qsat … … 2244 2270 cdans le thermique sinon 2245 2271 if (iflag_coupl.eq.0) then 2246 if (debut.and.prt_level.gt.9)WRITE(lunout,*) 'ALE&ALP imposes' 2247 Ale_bl(1:klon) = ale_bl_prescr 2248 Alp_bl(1:klon) = alp_bl_prescr 2272 if (debut.and.prt_level.gt.9) 2273 $ WRITE(lunout,*)'ALE et ALP imposes' 2274 do i = 1,klon 2275 con ne couple que ale 2276 c ALE(i) = max(ale_wake(i),Ale_bl(i)) 2277 ALE(i) = max(ale_wake(i),ale_bl_prescr) 2278 con ne couple que alp 2279 c ALP(i) = alp_wake(i) + Alp_bl(i) 2280 ALP(i) = alp_wake(i) + alp_bl_prescr 2281 enddo 2249 2282 else 2250 2283 IF(prt_level>9)WRITE(lunout,*)'ALE et ALP couples au thermique' 2251 endif 2284 ! do i = 1,klon 2285 ! ALE(i) = max(ale_wake(i),Ale_bl(i)) 2286 ! avant ALP(i) = alp_wake(i) + Alp_bl(i) 2287 ! ALP(i) = alp_wake(i) + Alp_bl(i) + alp_offset ! modif sb 2288 ! write(20,*)'ALE',ALE(i),Ale_bl(i),ale_wake(i) 2289 ! write(21,*)'ALP',ALP(i),Alp_bl(i),alp_wake(i) 2290 ! enddo 2252 2291 2253 2292 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 2256 2295 ! w si <0 2257 2296 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2258 2259 2297 do i = 1,klon 2260 2298 ALE(i) = max(ale_wake(i),Ale_bl(i)) 2299 ccc nrlmd le 10/04/2012----------Stochastic triggering-------------- 2300 if (iflag_trig_bl.ge.1) then 2301 ALE(i) = max(ale_wake(i),Ale_bl_trig(i)) 2302 endif 2303 ccc fin nrlmd le 10/04/2012 2261 2304 if (alp_offset>=0.) then 2262 2305 ALP(i) = alp_wake(i) + Alp_bl(i) + alp_offset ! modif sb … … 2269 2312 endif 2270 2313 enddo 2271 2272 2314 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2273 2315 2316 endif 2274 2317 do i=1,klon 2275 2318 if (alp(i)>alp_max) then … … 2586 2629 2587 2630 2588 if (iflag_thermals.gt.1) then 2631 ccc nrlmd le 10/04/2012 2632 DO k=1,klev+1 2633 DO i=1,klon 2634 pbl_tke_input(i,k,is_oce)=pbl_tke(i,k,is_oce) 2635 pbl_tke_input(i,k,is_ter)=pbl_tke(i,k,is_ter) 2636 pbl_tke_input(i,k,is_lic)=pbl_tke(i,k,is_lic) 2637 pbl_tke_input(i,k,is_sic)=pbl_tke(i,k,is_sic) 2638 ENDDO 2639 ENDDO 2640 ccc fin nrlmd le 10/04/2012 2641 2642 if (iflag_thermals>=1) then 2589 2643 call calltherm(pdtphys 2590 2644 s ,pplay,paprs,pphi,weak_inversion … … 2596 2650 con rajoute ale et alp, et les caracteristiques de la couche alim 2597 2651 s ,Ale_bl,Alp_bl,lalim_conv,wght_th, zmax0, f0, zw2,fraca 2598 s ,ztv,zpspsk,ztla,zthl) 2652 s ,ztv,zpspsk,ztla,zthl 2653 ccc nrlmd le 10/04/2012 2654 e ,pbl_tke_input,pctsrf,omega,airephy 2655 s ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 2656 s ,n2,s2,ale_bl_stat 2657 s ,therm_tke_max,env_tke_max 2658 s ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke 2659 s ,alp_bl_conv,alp_bl_stat 2660 ccc fin nrlmd le 10/04/2012 2661 s ) 2662 2663 ccc nrlmd le 10/04/2012 2664 c-----------Stochastic triggering----------- 2665 if (iflag_trig_bl.ge.1) then 2666 c 2667 IF (prt_level .GE. 10) THEN 2668 print *,'cin, ale_bl_stat, alp_bl_stat ', 2669 $ cin, ale_bl_stat, alp_bl_stat 2670 ENDIF 2671 2672 c----Initialisations 2673 do i=1,klon 2674 proba_notrig(i)=1. 2675 random_notrig(i)=1e6*ale_bl_stat(i)-int(1e6*ale_bl_stat(i)) 2676 if ( ale_bl_trig(i) .lt. abs(cin(i))+1.e-10 ) then 2677 tau_trig(i)=tau_trig_shallow 2678 else 2679 tau_trig(i)=tau_trig_deep 2680 endif 2681 enddo 2682 c 2683 IF (prt_level .GE. 10) THEN 2684 print *,'random_notrig, tau_trig ', 2685 $ random_notrig, tau_trig 2686 print *,'s_trig,s2,n2 ', 2687 $ s_trig,s2,n2 2688 ENDIF 2689 2690 c----Tirage aléatoire et calcul de ale_bl_trig 2691 do i=1,klon 2692 if ( (ale_bl_stat(i) .gt. abs(cin(i))+1.e-10) ) then 2693 proba_notrig(i)=(1.-exp(-s_trig/s2(i)))** 2694 $ (n2(i)*dtime/tau_trig(i)) 2695 c print *, 'proba_notrig(i) ',proba_notrig(i) 2696 if (random_notrig(i) .ge. proba_notrig(i)) then 2697 ale_bl_trig(i)=ale_bl_stat(i) 2698 else 2699 ale_bl_trig(i)=0. 2700 endif 2701 else 2702 proba_notrig(i)=1. 2703 random_notrig(i)=0. 2704 ale_bl_trig(i)=0. 2705 endif 2706 enddo 2707 c 2708 IF (prt_level .GE. 10) THEN 2709 print *,'proba_notrig, ale_bl_trig ', 2710 $ proba_notrig, ale_bl_trig 2711 ENDIF 2712 2713 endif !(iflag_trig_bl) 2714 2715 c-----------Statistical closure----------- 2716 if (iflag_clos_bl.ge.1) then 2717 2718 do i=1,klon 2719 alp_bl(i)=alp_bl_stat(i) 2720 enddo 2721 2722 else 2723 2724 alp_bl_stat(:)=0. 2725 2726 endif !(iflag_clos_bl) 2727 2728 IF (prt_level .GE. 10) THEN 2729 print *,'ale_bl_trig, alp_bl_stat ',ale_bl_trig, alp_bl_stat 2730 ENDIF 2731 2732 ccc fin nrlmd le 10/04/2012 2599 2733 2600 2734 ! ---------------------------------------------------------------------- … … 2627 2761 c ============== 2628 2762 2629 ! Dans le cas o \`uon active les thermiques, on fait partir l'ajustement2763 ! Dans le cas où on active les thermiques, on fait partir l'ajustement 2630 2764 ! a partir du sommet des thermiques. 2631 2765 ! Dans le cas contraire, on demarre au niveau 1. … … 2814 2948 ! FH 22/09/2009 2815 2949 ! La ligne ci-dessous faisait osciller le modele et donnait une solution 2816 ! as ymptotique bidon et d\'ependant fortement du pas de temps.2950 ! assymptotique bidon et dépendant fortement du pas de temps. 2817 2951 ! ratqs(:,:)=sqrt(ratqs(:,:)**2+ratqss(:,:)**2) 2818 2952 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 2842 2976 c Appeler le processus de condensation a grande echelle 2843 2977 c et le processus de precipitation 2978 c------------------------------------------------------------------------- 2979 IF (prt_level .GE.10) THEN 2980 print *,' ->fisrtilp ' 2981 ENDIF 2844 2982 c------------------------------------------------------------------------- 2845 2983 CALL fisrtilp(dtime,paprs,pplay, … … 2962 3100 cjq - introduce the aerosol direct and first indirect radiative forcings 2963 3101 cjq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr) 2964 IF ( ok_ade.OR.ok_aie) THEN3102 IF (flag_aerosol .gt. 0) THEN 2965 3103 IF (.NOT. aerosol_couple) 2966 3104 & CALL readaerosol_optic( … … 3247 3385 cIM betaCRF 3248 3386 c 3249 cldtaurad = cldtau 3250 cldemirad = cldemi 3387 cldtaurad = cldtau 3388 cldtaupirad = cldtaupi 3389 cldemirad = cldemi 3251 3390 c 3252 3391 if(lon1_beta.EQ.-180..AND.lon2_beta.EQ.180..AND. … … 3265 3404 beta(i,k) = beta(i,k) * pctsrf(i,is_oce) 3266 3405 endif 3267 cldtaurad(i,k) = cldtau(i,k) * beta(i,k) 3268 cldemirad(i,k) = cldemi(i,k) * beta(i,k) 3406 cldtaurad(i,k) = cldtau(i,k) * beta(i,k) 3407 cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k) 3408 cldemirad(i,k) = cldemi(i,k) * beta(i,k) 3269 3409 ENDDO 3270 3410 ENDDO … … 3287 3427 beta(i,k) = beta(i,k) * pctsrf(i,is_oce) 3288 3428 endif 3289 cldtaurad(i,k) = cldtau(i,k) * beta(i,k) 3290 cldemirad(i,k) = cldemi(i,k) * beta(i,k) 3429 cldtaurad(i,k) = cldtau(i,k) * beta(i,k) 3430 cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k) 3431 cldemirad(i,k) = cldemi(i,k) * beta(i,k) 3291 3432 endif 3292 3433 c … … 3337 3478 s topsw_aero, topsw0_aero, 3338 3479 s solsw_aero, solsw0_aero, 3339 e cldtaupi ,3480 e cldtaupirad, 3340 3481 s topswai_aero, solswai_aero) 3341 3482 … … 3351 3492 RCFC12 = RCFC12_act 3352 3493 c 3494 IF (prt_level .GE.10) THEN 3495 print *,' ->radlwsw, number 1 ' 3496 ENDIF 3497 c 3353 3498 CALL radlwsw 3354 3499 e (dist, rmu0, fract, … … 3356 3501 e t_seri,q_seri,wo, 3357 3502 e cldfra, cldemirad, cldtaurad, 3358 e ok_ade, ok_aie, 3503 e ok_ade, ok_aie, flag_aerosol, 3359 3504 e tau_aero, piz_aero, cg_aero, 3360 e cldtaupi ,new_aod,3505 e cldtaupirad,new_aod, 3361 3506 e zqsat, flwc, fiwc, 3362 3507 s heat,heat0,cool,cool0,radsol,albpla, … … 3388 3533 RCFC12 = RCFC12_per 3389 3534 c 3535 IF (prt_level .GE.10) THEN 3536 print *,' ->radlwsw, number 2 ' 3537 ENDIF 3538 c 3390 3539 CALL radlwsw 3391 3540 e (dist, rmu0, fract, … … 3393 3542 e t_seri,q_seri,wo, 3394 3543 e cldfra, cldemi, cldtau, 3395 e ok_ade, ok_aie, 3544 e ok_ade, ok_aie, flag_aerosol, 3396 3545 e tau_aero, piz_aero, cg_aero, 3397 3546 e cldtaupi,new_aod, … … 3479 3628 c Appeler le programme de parametrisation de l'orographie 3480 3629 c a l'echelle sous-maille: 3630 c 3631 IF (prt_level .GE.10) THEN 3632 print *,' call orography ? ', ok_orodr 3633 ENDIF 3481 3634 c 3482 3635 IF (ok_orodr) THEN … … 3569 3722 3570 3723 IF (ok_hines) then 3724 3571 3725 CALL hines_gwd(klon,klev,dtime,paprs,pplay, 3572 3726 i rlat,t_seri,u_seri,v_seri, … … 3576 3730 c ajout des tendances 3577 3731 CALL add_phys_tend(d_u_hin,d_v_hin,d_t_hin,dq0,dql0,'hin') 3732 3578 3733 ENDIF 3579 3734 c 3735 3736 c 3737 cIM cf. FLott BEG 3580 3738 C STRESS NECESSAIRES: TOUTE LA PHYSIQUE 3581 3739 … … 3602 3760 cIM calcul composantes axiales du moment angulaire et couple des montagnes 3603 3761 c 3604 IF (is_sequential .and. ok_orodr) THEN 3605 3762 IF (is_sequential .and. ok_orodr) THEN 3606 3763 CALL aaam_bud (27,klon,klev,jD_cur-jD_ref,jH_cur, 3607 3764 C ra,rg,romega, … … 3898 4055 c Convertir les incrementations en tendances 3899 4056 c 4057 IF (prt_level .GE.10) THEN 4058 print *,'Convertir les incrementations en tendances ' 4059 ENDIF 4060 c 3900 4061 if (mydebug) then 3901 4062 call writefield_phy('u_seri',u_seri,llm) … … 4016 4177 c============================================================= 4017 4178 4018 if (iflag_thermals> 1) then4179 if (iflag_thermals>=1) then 4019 4180 d_t_lscth=0. 4020 4181 d_t_lscst=0. -
LMDZ5/branches/testing/libf/phylmd/radlwsw.F90
r1664 r1669 10 10 t,q,wo,& 11 11 cldfra, cldemi, cldtaupd,& 12 ok_ade, ok_aie, &12 ok_ade, ok_aie, flag_aerosol,& 13 13 tau_aero, piz_aero, cg_aero,& 14 14 cldtaupi, new_aod, & … … 56 56 ! ok_ade---input-L- apply the Aerosol Direct Effect or not? 57 57 ! ok_aie---input-L- apply the Aerosol Indirect Effect or not? 58 ! flag_aerosol-input-I- aerosol flag from 0 to 6 58 59 ! tau_ae, piz_ae, cg_ae-input-R- aerosol optical properties (calculated in aeropt.F) 59 60 ! cldtaupi-input-R- epaisseur optique des nuages dans le visible … … 119 120 120 121 LOGICAL, INTENT(in) :: ok_ade, ok_aie ! switches whether to use aerosol direct (indirect) effects or not 122 INTEGER, INTENT(in) :: flag_aerosol ! takes value 0 (no aerosol) or 1 to 6 (aerosols) 121 123 REAL, INTENT(in) :: cldfra(KLON,KLEV), cldemi(KLON,KLEV), cldtaupd(KLON,KLEV) 122 124 REAL, INTENT(in) :: tau_aero(KLON,KLEV,9,2) ! aerosol optical properties (see aeropt.F) … … 354 356 zalbpla,ztopsw,zsolsw,ztopsw0,zsolsw0,& 355 357 ZFSUP,ZFSDN,ZFSUP0,ZFSDN0,& 356 tau _aero(:,:,5,:), piz_aero(:,:,5,:), cg_aero(:,:,5,:),&358 tauaero(:,:,5,:), pizaero(:,:,5,:), cgaero(:,:,5,:),& 357 359 PTAUA, POMEGAA,& 358 360 ztopswadaero,zsolswadaero,& 359 361 ztopswaiaero,zsolswaiaero,& 360 ok_ade, ok_aie )362 ok_ade, ok_aie, flag_aerosol) 361 363 362 364 ELSE ! new_aod=T … … 377 379 zsolsw_aero,zsolsw0_aero,& 378 380 ztopswcf_aero,zsolswcf_aero, & 379 ok_ade, ok_aie) 380 381 ok_ade, ok_aie, flag_aerosol) 381 382 ENDIF 382 383 -
LMDZ5/branches/testing/libf/phylmd/regr_lat_time_climoz_m.F90
r1279 r1669 224 224 ! Get the number of months: 225 225 call nf95_inq_dimid(ncid_in, "time", dimid) 226 call nf95_inquire_dimension(ncid_in, dimid, len=n_month)226 call nf95_inquire_dimension(ncid_in, dimid, nclen=n_month) 227 227 228 228 allocate(o3_in(n_lat, n_plev, n_month, read_climoz)) -
LMDZ5/branches/testing/libf/phylmd/sw_aeroAR4.F90
r1664 r1669 18 18 PSOLSWAERO,PSOLSW0AERO,& 19 19 PTOPSWCFAERO,PSOLSWCFAERO,& 20 ok_ade, ok_aie )20 ok_ade, ok_aie, flag_aerosol ) 21 21 22 22 USE dimphy 23 23 USE phys_output_mod, ONLY : swaero_diag 24 24 IMPLICIT NONE 25 25 … … 56 56 ! -------------- 57 57 ! ORIGINAL : 89-07-14 58 ! 95-01-01 J.-J. MORCRETTE Direct/Diffuse Albedo 59 ! 03-11-27 J. QUAAS Introduce aerosol forcings (based on BOUCHER) 60 ! 09-04 A. COZIC - C.DEANDREIS Indroduce NAT/BC/POM/DUST/SS aerosol forcing 58 ! 1995-01-01 J.-J. MORCRETTE Direct/Diffuse Albedo 59 ! 2003-11-27 J. QUAAS Introduce aerosol forcings (based on BOUCHER) 60 ! 2009-04 A. COZIC - C.DEANDREIS Indroduce NAT/BC/POM/DUST/SS aerosol forcing 61 ! 2012-09 O. BOUCHER - reorganise aerosol cases with ok_ade, ok_aie, flag_aerosol 61 62 ! ------------------------------------------------------------------ 62 63 ! … … 82 83 83 84 REAL(KIND=8) PCLDSW(KDLON,KFLEV) ! CLOUD FRACTION 84 REAL(KIND=8) PTAU(KDLON,2,KFLEV) ! CLOUD OPTICAL THICKNESS 85 REAL(KIND=8) PTAU(KDLON,2,KFLEV) ! CLOUD OPTICAL THICKNESS (pre-industrial value) 85 86 REAL(KIND=8) PCG(KDLON,2,KFLEV) ! ASYMETRY FACTOR 86 87 REAL(KIND=8) POMEGA(KDLON,2,KFLEV) ! SINGLE SCATTERING ALBEDO … … 132 133 !$OMP THREADPRIVATE(initialized) 133 134 134 !jq- Introduced for aerosol forcings135 !jq-local flag introduced for aerosol forcings 135 136 REAL(KIND=8), SAVE :: flag_aer 136 137 !$OMP THREADPRIVATE(flag_aer) 137 138 138 139 LOGICAL ok_ade, ok_aie ! use aerosol forcings or not? 140 INTEGER flag_aerosol ! global flag for aerosol 0 (no aerosol) or 1-5 (aerosols) 139 141 REAL(KIND=8) tauaero(kdlon,kflev,9,2) ! aerosol optical properties 140 142 REAL(KIND=8) pizaero(kdlon,kflev,9,2) ! (see aeropt.F) 141 143 REAL(KIND=8) cgaero(kdlon,kflev,9,2) ! -"- 142 REAL(KIND=8) PTAUA(KDLON,2,KFLEV) ! CLOUD OPTICAL THICKNESS (pre -industrialvalue)144 REAL(KIND=8) PTAUA(KDLON,2,KFLEV) ! CLOUD OPTICAL THICKNESS (present-day value) 143 145 REAL(KIND=8) POMEGAA(KDLON,2,KFLEV) ! SINGLE SCATTERING ALBEDO 144 146 REAL(KIND=8) PTOPSWADAERO(KDLON) ! SHORTWAVE FLUX AT T.O.A.(+AEROSOL DIR) 145 147 REAL(KIND=8) PSOLSWADAERO(KDLON) ! SHORTWAVE FLUX AT SURFACE(+AEROSOL DIR) 146 REAL(KIND=8) PTOPSWAD0AERO(KDLON) 147 REAL(KIND=8) PSOLSWAD0AERO(KDLON) 148 REAL(KIND=8) PTOPSWAD0AERO(KDLON) ! SHORTWAVE FLUX AT T.O.A.(+AEROSOL DIR) 149 REAL(KIND=8) PSOLSWAD0AERO(KDLON) ! SHORTWAVE FLUX AT SURFACE(+AEROSOL DIR) 148 150 REAL(KIND=8) PTOPSWAIAERO(KDLON) ! SHORTWAVE FLUX AT T.O.A.(+AEROSOL IND) 149 151 REAL(KIND=8) PSOLSWAIAERO(KDLON) ! SHORTWAVE FLUX AT SURFACE(+AEROSOL IND) 150 REAL(KIND=8) PTOPSWAERO(KDLON,9) 151 REAL(KIND=8) PTOPSW0AERO(KDLON,9) 152 REAL(KIND=8) PSOLSWAERO(KDLON,9) 153 REAL(KIND=8) PSOLSW0AERO(KDLON,9) 152 REAL(KIND=8) PTOPSWAERO(KDLON,9) ! SW TOA AS DRF nat & ant 153 REAL(KIND=8) PTOPSW0AERO(KDLON,9) ! SW SRF AS DRF nat & ant 154 REAL(KIND=8) PSOLSWAERO(KDLON,9) ! SW TOA CS DRF nat & ant 155 REAL(KIND=8) PSOLSW0AERO(KDLON,9) ! SW SRF CS DRF nat & ant 154 156 REAL(KIND=8) PTOPSWCFAERO(KDLON,3) ! SW TOA AS cloudRF nat & ant 155 157 REAL(KIND=8) PSOLSWCFAERO(KDLON,3) ! SW SRF AS cloudRF nat & ant … … 179 181 180 182 ! Key to define the aerosol effect acting on climate 181 ! 0: aerosol feedback active according to ok_ade, ok_aie DEFAULT 182 ! 1: no feedback , zero aerosol fluxes are used for climate, diagnostics according to ok_ade_ok_aie 183 ! 2: feedback according to total aerosol direct effect used for climate, diagnostics according to ok_ade, ok_aie 184 ! 3: feedback according to natural aerosol direct effect used for climate, diagnostics according to ok_ade_ok_aie 185 186 INTEGER,SAVE :: AEROSOLFEEDBACK_ACTIVE = 0 183 ! OB: AEROSOLFEEDBACK_ACTIVE is now a LOGICAL 184 ! TRUE: fluxes use natural and/or anthropogenic aerosols according to ok_ade and ok_aie, DEFAULT 185 ! FALSE: fluxes use no aerosols (case 1) 186 187 LOGICAL,SAVE :: AEROSOLFEEDBACK_ACTIVE = .TRUE. 187 188 !$OMP THREADPRIVATE(AEROSOLFEEDBACK_ACTIVE) 188 189 189 190 CHARACTER (LEN=20) :: modname='sw_aeroAR4' 190 191 CHARACTER (LEN=80) :: abort_message 191 192 IF ((.not. ok_ade) .and. (AEROSOLFEEDBACK_ACTIVE .ge. 2)) THEN193 abort_message ='Error: direct effect is not activated but assumed to be active - see sw_aeroAR4.F90'194 CALL abort_gcm (modname,abort_message,1)195 ENDIF196 AEROSOLFEEDBACK_ACTIVE=MIN(MAX(AEROSOLFEEDBACK_ACTIVE,0),3)197 IF (AEROSOLFEEDBACK_ACTIVE .gt. 3) THEN198 abort_message ='Error: AEROSOLFEEDBACK_ACTIVE options go only until 3'199 CALL abort_gcm (modname,abort_message,1)200 ENDIF201 192 202 193 IF(.NOT.initialized) THEN … … 209 200 ALLOCATE(ZFSUPAI_AERO(KDLON,KFLEV+1)) 210 201 ALLOCATE(ZFSDNAI_AERO(KDLON,KFLEV+1)) 211 ALLOCATE(ZFSUP_AERO (KDLON,KFLEV+1,9)) 212 ALLOCATE(ZFSDN_AERO (KDLON,KFLEV+1,9)) 213 ALLOCATE(ZFSUP0_AERO(KDLON,KFLEV+1,9)) 214 ALLOCATE(ZFSDN0_AERO(KDLON,KFLEV+1,9)) 202 !-OB decrease size of these arrays to what is needed 203 ! | direct effect 204 !ind effect | no aerosol natural total 205 !natural (PTAU) | 1 3 2 --ZFSUP/ZFSDN 206 !total (PTAUA) | 5 4 --ZFSUP/ZFSDN 207 !no cloud | 1 3 2 --ZFSUP0/ZFSDN0 208 ! so we need which case when ? 209 ! ok_ade and ok_aie = 4-5, 4-2 and 2 210 ! ok_ade and not ok_aie = 2-3 and 2 211 ! not ok_ade and ok_aie = 5-3 and 5 212 ! not ok_ade and not ok_aie = 3 213 ! therefore the cases have the folliwng switches 214 ! 3 = not ok_ade or not ok_aie 215 ! 4 = ok_ade and ok_aie 216 ! 2 = ok_ade 217 ! 5 = ok_aie 218 ALLOCATE(ZFSUP_AERO (KDLON,KFLEV+1,5)) 219 ALLOCATE(ZFSDN_AERO (KDLON,KFLEV+1,5)) 220 ALLOCATE(ZFSUP0_AERO(KDLON,KFLEV+1,3)) 221 ALLOCATE(ZFSDN0_AERO(KDLON,KFLEV+1,3)) 222 ! end OB modif 215 223 ZFSUPAD_AERO(:,:)=0. 216 224 ZFSDNAD_AERO(:,:)=0. … … 226 234 227 235 IF (appel1er) THEN 228 WRITE(lunout,*) 236 WRITE(lunout,*)'SW calling frequency : ', swpas 229 237 WRITE(lunout,*) " In general, it should be 1" 230 238 appel1er = .FALSE. … … 241 249 ENDDO 242 250 243 ! clear sky is either computed IF no direct effect is asked for, or for extended diag)244 IF ( ( lev_histmth .ge. 4 ) .or. ( .not. ok_ade )) THEN251 ! clear sky with no aerosols at all is computed IF ACTIVEFEEDBACK_ACTIVE is false or for extended diag 252 IF ( swaero_diag .or. .not. AEROSOLFEEDBACK_ACTIVE .OR. flag_aerosol .EQ. 0 ) THEN 245 253 246 254 ! clear-sky: zero aerosol effect … … 268 276 ENDDO 269 277 ENDDO 270 ENDIF 271 272 ! cloudy sky is either computed IF no indirect effect is asked for, or for extended diag)273 IF ( ( lev_histmth .ge. 4 ) .or. ( .not. ok_aie )) THEN278 ENDIF ! swaero_diag .or. .not. AEROSOLFEEDBACK_ACTIVE 279 280 ! cloudy sky with no aerosols at all is either computed IF no indirect effect is asked for, or for extended diag 281 IF ( swaero_diag .or. .not. AEROSOLFEEDBACK_ACTIVE .OR. flag_aerosol .EQ. 0 ) THEN 274 282 ! cloudy-sky: zero aerosol effect 275 283 flag_aer=0.0 … … 297 305 ENDDO 298 306 ENDDO 299 ENDIF 300 307 ENDIF ! swaero_diag .or. .not. AEROSOLFEEDBACK_ACTIVE 308 309 IF (flag_aerosol .GT. 0 ) THEN 310 311 IF (ok_ade.and.swaero_diag .or. .not. ok_ade) THEN 312 313 ! clear sky direct effect natural aerosol 314 ! CAS AER (3) 315 flag_aer=1.0 316 CALL SWU_LMDAR4(PSCT,ZCLDSW0,PPMB,PPSOL,& 317 PRMU0,PFRAC,PTAVE,PWV,& 318 ZAKI,ZCLD,ZCLEAR,ZDSIG,ZFACT,ZRMU,ZSEC,ZUD) 319 INU = 1 320 CALL SW1S_LMDAR4(INU, PAER, flag_aer,& 321 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 322 PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 323 ZDSIG, POMEGA, ZOZ, ZRMU, ZSEC, PTAU, ZUD,& 324 ZFD, ZFU) 325 INU = 2 326 CALL SW2S_LMDAR4(INU, PAER, flag_aer,& 327 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 328 ZAKI, PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 329 ZDSIG, POMEGA, ZOZ, ZRMU, ZSEC, PTAU, ZUD,& 330 PWV, PQS,& 331 ZFDOWN, ZFUP) 332 333 DO JK = 1 , KFLEV+1 334 DO JL = 1, KDLON 335 ZFSUP0_AERO(JL,JK,3) = (ZFUP(JL,JK) + ZFU(JL,JK)) * ZFACT(JL) 336 ZFSDN0_AERO(JL,JK,3) = (ZFDOWN(JL,JK) + ZFD(JL,JK)) * ZFACT(JL) 337 ENDDO 338 ENDDO 339 ENDIF !--end not swaero_diag or not ok_ade 301 340 302 341 IF (ok_ade) THEN 303 342 304 ! clear sky (Anne Cozic 03/07/2007)direct effect of total aerosol343 ! clear sky direct effect of total aerosol 305 344 ! CAS AER (2) 306 345 flag_aer=1.0 … … 329 368 ENDDO 330 369 331 ! cloudy sky is either computed IF no indirect effect is asked for, or for extended diag) 332 IF (( lev_histmth .ge. 2 ) .or. (.not. ok_aie)) THEN 333 ! cloudy-sky aerosol direct effect of total aerosol 370 ! cloudy-sky with natural aerosols for indirect effect 371 ! but total aerosols for direct effect 372 ! PTAU 373 ! CAS AER (2) 334 374 flag_aer=1.0 335 375 CALL SWU_LMDAR4(PSCT,PCLDSW,PPMB,PPSOL,& … … 356 396 ENDDO 357 397 ENDDO 358 ENDIF 359 360 ! natural aeroosl clear sky is computed for extended diag) 361 IF ( lev_histmth .ge. 4 ) THEN 362 ! clear sky direct effect natural aerosol 363 flag_aer=1.0 364 CALL SWU_LMDAR4(PSCT,ZCLDSW0,PPMB,PPSOL,& 365 PRMU0,PFRAC,PTAVE,PWV,& 366 ZAKI,ZCLD,ZCLEAR,ZDSIG,ZFACT,ZRMU,ZSEC,ZUD) 367 INU = 1 368 CALL SW1S_LMDAR4(INU, PAER, flag_aer,& 369 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 370 PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 371 ZDSIG, POMEGA, ZOZ, ZRMU, ZSEC, PTAU, ZUD,& 372 ZFD, ZFU) 373 INU = 2 374 CALL SW2S_LMDAR4(INU, PAER, flag_aer,& 375 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 376 ZAKI, PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 377 ZDSIG, POMEGA, ZOZ, ZRMU, ZSEC, PTAU, ZUD,& 378 PWV, PQS,& 379 ZFDOWN, ZFUP) 380 381 DO JK = 1 , KFLEV+1 382 DO JL = 1, KDLON 383 ZFSUP0_AERO(JL,JK,3) = (ZFUP(JL,JK) + ZFU(JL,JK)) * ZFACT(JL) 384 ZFSDN0_AERO(JL,JK,3) = (ZFDOWN(JL,JK) + ZFD(JL,JK)) * ZFACT(JL) 385 ENDDO 386 ENDDO 387 ENDIF 388 389 ! cloud sky natural is for extended diagnostics 390 IF ( lev_histmth .ge. 2 ) THEN 398 399 ENDIF !-end ok_ade 400 401 IF ( .not. ok_ade .or. .not. ok_aie ) THEN 402 403 ! cloudy-sky with natural aerosols for indirect effect 404 ! and natural aerosols for direct effect 405 ! PTAU 406 ! CAS AER (3) 391 407 ! cloudy-sky direct effect natural aerosol 392 408 flag_aer=1.0 … … 414 430 ENDDO 415 431 ENDDO 416 ENDIF 417 418 ENDIF ! ok_ade 419 420 ! cloudy sky needs to be computed in all cases IF ok_aie is activated 421 IF (ok_aie) THEN 422 !jq cloudy-sky + aerosol direct + aerosol indirect of total aerosol 432 433 ENDIF !--true/false or false/true 434 435 IF (ok_ade .and. ok_aie) THEN 436 437 ! cloudy-sky with total aerosols for indirect effect 438 ! and total aerosols for direct effect 439 ! PTAUA 440 ! CAS AER (2) 423 441 flag_aer=1.0 424 442 CALL SWU_LMDAR4(PSCT,PCLDSW,PPMB,PPSOL,& … … 438 456 PWV, PQS,& 439 457 ZFDOWN, ZFUP) 458 440 459 DO JK = 1 , KFLEV+1 441 460 DO JL = 1, KDLON … … 444 463 ENDDO 445 464 ENDDO 465 466 ENDIF ! ok_ade .and. ok_aie 467 468 IF (ok_aie) THEN 469 ! cloudy-sky with total aerosols for indirect effect 470 ! and natural aerosols for direct effect 471 ! PTAUA 472 ! CAS AER (3) 473 flag_aer=1.0 474 CALL SWU_LMDAR4(PSCT,PCLDSW,PPMB,PPSOL,& 475 PRMU0,PFRAC,PTAVE,PWV,& 476 ZAKI,ZCLD,ZCLEAR,ZDSIG,ZFACT,ZRMU,ZSEC,ZUD) 477 INU = 1 478 CALL SW1S_LMDAR4(INU, PAER, flag_aer,& 479 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 480 PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 481 ZDSIG, POMEGAA, ZOZ, ZRMU, ZSEC, PTAUA, ZUD,& 482 ZFD, ZFU) 483 INU = 2 484 CALL SW2S_LMDAR4(INU, PAER, flag_aer,& 485 tauaero(:,:,3,:), pizaero(:,:,3,:), cgaero(:,:,3,:),& 486 ZAKI, PALBD, PALBP, PCG, ZCLD, ZCLEAR, PCLDSW,& 487 ZDSIG, POMEGAA, ZOZ, ZRMU, ZSEC, PTAUA, ZUD,& 488 PWV, PQS,& 489 ZFDOWN, ZFUP) 490 491 DO JK = 1 , KFLEV+1 492 DO JL = 1, KDLON 493 ZFSUP_AERO(JL,JK,5) = (ZFUP(JL,JK) + ZFU(JL,JK)) * ZFACT(JL) 494 ZFSDN_AERO(JL,JK,5) = (ZFDOWN(JL,JK) + ZFD(JL,JK)) * ZFACT(JL) 495 ENDDO 496 ENDDO 497 446 498 ENDIF ! ok_aie 447 499 500 ENDIF !--if flag_aerosol GT 0 501 448 502 itapsw = 0 449 503 ENDIF 450 504 itapsw = itapsw + 1 451 505 452 IF ( AEROSOLFEEDBACK_ACTIVE . eq. 0) THEN506 IF ( AEROSOLFEEDBACK_ACTIVE .AND. flag_aerosol .GT. 0 ) THEN 453 507 IF ( ok_ade .and. ok_aie ) THEN 454 508 ZFSUP(:,:) = ZFSUP_AERO(:,:,4) … … 457 511 ZFSDN0(:,:) = ZFSDN0_AERO(:,:,2) 458 512 ENDIF 513 459 514 IF ( ok_ade .and. (.not. ok_aie) ) THEN 460 515 ZFSUP(:,:) = ZFSUP_AERO(:,:,2) … … 465 520 466 521 IF ( (.not. ok_ade) .and. ok_aie ) THEN 467 print*,'Warning: indirect effect in cloudy regions includes direct aerosol effect'468 ZFS UP(:,:) = ZFSUP_AERO(:,:,4)469 ZFS DN(:,:) = ZFSDN_AERO(:,:,4)470 ZFS UP0(:,:) = ZFSUP0_AERO(:,:,1)471 ZFSDN0(:,:) = ZFSDN0_AERO(:,:,1)472 ENDIF 522 ZFSUP(:,:) = ZFSUP_AERO(:,:,5) 523 ZFSDN(:,:) = ZFSDN_AERO(:,:,5) 524 ZFSUP0(:,:) = ZFSUP0_AERO(:,:,3) 525 ZFSDN0(:,:) = ZFSDN0_AERO(:,:,3) 526 ENDIF 527 473 528 IF ((.not. ok_ade) .and. (.not. ok_aie)) THEN 529 ZFSUP(:,:) = ZFSUP_AERO(:,:,3) 530 ZFSDN(:,:) = ZFSDN_AERO(:,:,3) 531 ZFSUP0(:,:) = ZFSUP0_AERO(:,:,3) 532 ZFSDN0(:,:) = ZFSDN0_AERO(:,:,3) 533 ENDIF 534 535 ! MS the following allows to compute the forcing diagostics without 536 ! letting the aerosol forcing act on the meteorology 537 ! SEE logic above 538 ELSE 474 539 ZFSUP(:,:) = ZFSUP_AERO(:,:,1) 475 540 ZFSDN(:,:) = ZFSDN_AERO(:,:,1) … … 478 543 ENDIF 479 544 480 ! MS the following allows to compute the forcing diagostics without 481 ! letting the aerosol forcing act on the meteorology 482 ! SEE logic above 483 ELSEIF ( AEROSOLFEEDBACK_ACTIVE .gt. 0) THEN 484 ZFSUP(:,:) = ZFSUP_AERO(:,:,AEROSOLFEEDBACK_ACTIVE) 485 ZFSDN(:,:) = ZFSDN_AERO(:,:,AEROSOLFEEDBACK_ACTIVE) 486 ZFSUP0(:,:) = ZFSUP0_AERO(:,:,AEROSOLFEEDBACK_ACTIVE) 487 ZFSDN0(:,:) = ZFSDN0_AERO(:,:,AEROSOLFEEDBACK_ACTIVE) 488 ENDIF 489 490 545 ! Now computes heating rates 491 546 DO k = 1, KFLEV 492 547 kpl1 = k+1 … … 511 566 PTOPSW(i) = ZFSDN(i,KFLEV+1) - ZFSUP(i,KFLEV+1) 512 567 513 514 568 ! net anthropogenic forcing direct and 1st indirect effect diagnostics 515 569 ! requires a natural aerosol field read and used 516 570 ! Difference of net fluxes from double call to radiation 517 571 518 519 572 IF (ok_ade) THEN 520 573 521 574 ! indices 1: natural; 2 anthropogenic 575 522 576 ! TOA/SRF all sky natural forcing 523 577 PSOLSWAERO(i,1) = (ZFSDN_AERO(i,1,3) - ZFSUP_AERO(i,1,3))-(ZFSDN_AERO(i,1,1) - ZFSUP_AERO(i,1,1)) 524 578 PTOPSWAERO(i,1) = (ZFSDN_AERO(i,KFLEV+1,3) - ZFSUP_AERO(i,KFLEV+1,3))- (ZFSDN_AERO(i,KFLEV+1,1) - ZFSUP_AERO(i,KFLEV+1,1)) 525 579 580 ! TOA/SRF clear sky natural forcing 581 PSOLSW0AERO(i,1) = (ZFSDN0_AERO(i,1,3) - ZFSUP0_AERO(i,1,3))-(ZFSDN0_AERO(i,1,1) - ZFSUP0_AERO(i,1,1)) 582 PTOPSW0AERO(i,1) = (ZFSDN0_AERO(i,KFLEV+1,3) - ZFSUP0_AERO(i,KFLEV+1,3))-(ZFSDN0_AERO(i,KFLEV+1,1) - ZFSUP0_AERO(i,KFLEV+1,1)) 583 584 IF (ok_aie) THEN 585 586 ! TOA/SRF all sky anthropogenic forcing 587 PSOLSWAERO(i,2) = (ZFSDN_AERO(i,1,4) - ZFSUP_AERO(i,1,4))-(ZFSDN_AERO(i,1,5) - ZFSUP_AERO(i,1,5)) 588 PTOPSWAERO(i,2) = (ZFSDN_AERO(i,KFLEV+1,4) - ZFSUP_AERO(i,KFLEV+1,4))- (ZFSDN_AERO(i,KFLEV+1,5) - ZFSUP_AERO(i,KFLEV+1,5)) 589 590 ELSE 591 526 592 ! TOA/SRF all sky anthropogenic forcing 527 593 PSOLSWAERO(i,2) = (ZFSDN_AERO(i,1,2) - ZFSUP_AERO(i,1,2))-(ZFSDN_AERO(i,1,3) - ZFSUP_AERO(i,1,3)) 528 594 PTOPSWAERO(i,2) = (ZFSDN_AERO(i,KFLEV+1,2) - ZFSUP_AERO(i,KFLEV+1,2))- (ZFSDN_AERO(i,KFLEV+1,3) - ZFSUP_AERO(i,KFLEV+1,3)) 529 595 530 ! TOA/SRF clear sky natural forcing 531 PSOLSW0AERO(i,1) = (ZFSDN0_AERO(i,1,3) - ZFSUP0_AERO(i,1,3))-(ZFSDN0_AERO(i,1,1) - ZFSUP0_AERO(i,1,1)) 532 PTOPSW0AERO(i,1) = (ZFSDN0_AERO(i,KFLEV+1,3) - ZFSUP0_AERO(i,KFLEV+1,3))-(ZFSDN0_AERO(i,KFLEV+1,1) - ZFSUP0_AERO(i,KFLEV+1,1)) 596 ENDIF 533 597 534 598 ! TOA/SRF clear sky anthropogenic forcing … … 536 600 PTOPSW0AERO(i,2) = (ZFSDN0_AERO(i,KFLEV+1,2) - ZFSUP0_AERO(i,KFLEV+1,2))-(ZFSDN0_AERO(i,KFLEV+1,3) - ZFSUP0_AERO(i,KFLEV+1,3)) 537 601 602 ! direct anthropogenic forcing , as in old LMDzT, however differences of net fluxes 603 PSOLSWADAERO(i) = PSOLSWAERO(i,2) 604 PTOPSWADAERO(i) = PTOPSWAERO(i,2) 605 PSOLSWAD0AERO(i) = PSOLSW0AERO(i,2) 606 PTOPSWAD0AERO(i) = PTOPSW0AERO(i,2) 607 608 ! OB: these diagnostics may not always work but who need them 538 609 ! Cloud forcing indices 1: natural; 2 anthropogenic; 3: zero aerosol direct effect 539 610 ! Instantaneously computed cloudy sky direct aerosol effect, cloud forcing due to aerosols above clouds … … 552 623 PTOPSWCFAERO(i,3) = (ZFSDN_AERO(i,KFLEV+1,1) - ZFSUP_AERO(i,KFLEV+1,1))- (ZFSDN0_AERO(i,KFLEV+1,1) - ZFSUP0_AERO(i,KFLEV+1,1)) 553 624 554 ! direct anthropogenic forcing , as in old LMDzT, however differences of net fluxes555 PSOLSWADAERO(i) = PSOLSWAERO(i,2)556 PTOPSWADAERO(i) = PTOPSWAERO(i,2)557 PSOLSWAD0AERO(i) = PSOLSW0AERO(i,2)558 PTOPSWAD0AERO(i) = PTOPSW0AERO(i,2)559 560 625 ENDIF 561 626 562 563 627 IF (ok_aie) THEN 628 IF (ok_ade) THEN 564 629 PSOLSWAIAERO(i) = (ZFSDN_AERO(i,1,4) - ZFSUP_AERO(i,1,4))-(ZFSDN_AERO(i,1,2) - ZFSUP_AERO(i,1,2)) 565 630 PTOPSWAIAERO(i) = (ZFSDN_AERO(i,KFLEV+1,4) - ZFSUP_AERO(i,KFLEV+1,4))-(ZFSDN_AERO(i,KFLEV+1,2) - ZFSUP_AERO(i,KFLEV+1,2)) 631 ELSE 632 PSOLSWAIAERO(i) = (ZFSDN_AERO(i,1,5) - ZFSUP_AERO(i,1,5))-(ZFSDN_AERO(i,1,3) - ZFSUP_AERO(i,1,3)) 633 PTOPSWAIAERO(i) = (ZFSDN_AERO(i,KFLEV+1,5) - ZFSUP_AERO(i,KFLEV+1,5))-(ZFSDN_AERO(i,KFLEV+1,3) - ZFSUP_AERO(i,KFLEV+1,3)) 634 ENDIF 566 635 ENDIF 567 636 568 ENDDO 637 ENDDO 638 569 639 END SUBROUTINE SW_AEROAR4 -
LMDZ5/branches/testing/libf/phylmd/thermcell.h
r1496 r1669 1 1 integer :: iflag_thermals,nsplit_thermals 2 3 !!! nrlmd le 10/04/2012 4 integer :: iflag_trig_bl,iflag_clos_bl 5 integer :: tau_trig_shallow,tau_trig_deep 6 real :: s_trig 7 !!! fin nrlmd le 10/04/2012 8 2 9 real,parameter :: r_aspect_thermals=2.,l_mix_thermals=30. 3 10 real :: alp_bl_k 4 11 real :: tau_thermals 5 integer,parameter :: w2di_thermals= 112 integer,parameter :: w2di_thermals=0 6 13 integer :: isplit 7 14 … … 14 21 common/ctherm5/iflag_thermals_ed,iflag_thermals_optflux 15 22 23 !!! nrlmd le 10/04/2012 24 common/ctherm6/iflag_trig_bl,iflag_clos_bl 25 common/ctherm7/tau_trig_shallow,tau_trig_deep 26 common/ctherm8/s_trig 27 !!! fin nrlmd le 10/04/2012 28 16 29 !$OMP THREADPRIVATE(/ctherm1/,/ctherm2/,/ctherm4/,/ctherm5/) 30 !$OMP THREADPRIVATE(/ctherm6/,/ctherm7/,/ctherm8/) -
LMDZ5/branches/testing/libf/phylmd/thermcell_main.F90
r1525 r1669 10 10 & ,Ale_bl,Alp_bl,lalim_conv,wght_th & 11 11 & ,zmax0, f0,zw2,fraca,ztv & 12 & ,zpspsk,ztla,zthl) 12 & ,zpspsk,ztla,zthl & 13 !!! nrlmd le 10/04/2012 14 & ,pbl_tke,pctsrf,omega,airephy & 15 & ,zlcl,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 & 16 & ,n2,s2,ale_bl_stat & 17 & ,therm_tke_max,env_tke_max & 18 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & 19 & ,alp_bl_conv,alp_bl_stat & 20 !!! fin nrlmd le 10/04/2012 21 & ) 13 22 14 23 USE dimphy … … 47 56 #include "iniprint.h" 48 57 #include "thermcell.h" 58 !!! nrlmd le 10/04/2012 59 #include "indicesol.h" 60 !!! fin nrlmd le 10/04/2012 49 61 50 62 ! arguments: … … 77 89 integer,save :: lev_out=10 78 90 !$OMP THREADPRIVATE(lev_out) 91 92 REAL susqr2pi, Reuler 79 93 80 94 INTEGER ig,k,l,ll,ierr … … 155 169 real seuil 156 170 real csc(klon,klev) 171 172 !!! nrlmd le 10/04/2012 173 174 !------Entrées 175 real pbl_tke(klon,klev+1,nbsrf) 176 real pctsrf(klon,nbsrf) 177 real omega(klon,klev) 178 real airephy(klon) 179 !------Sorties 180 real zlcl(klon),fraca0(klon),w0(klon),w_conv(klon) 181 real therm_tke_max0(klon),env_tke_max0(klon) 182 real n2(klon),s2(klon) 183 real ale_bl_stat(klon) 184 real therm_tke_max(klon,klev),env_tke_max(klon,klev) 185 real alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon) 186 !------Local 187 integer nsrf 188 real rhobarz0(klon) ! Densité au LCL 189 logical ok_lcl(klon) ! Existence du LCL des thermiques 190 integer klcl(klon) ! Niveau du LCL 191 real interp(klon) ! Coef d'interpolation pour le LCL 192 !--Triggering 193 real Su ! Surface unité: celle d'un updraft élémentaire 194 parameter(Su=4e4) 195 real hcoef ! Coefficient directeur pour le calcul de s2 196 parameter(hcoef=1) 197 real hmincoef ! Coefficient directeur pour l'ordonnée à l'origine pour le calcul de s2 198 parameter(hmincoef=0.3) 199 real eps1 ! Fraction de surface occupée par la population 1 : eps1=n1*s1/(fraca0*Sd) 200 parameter(eps1=0.3) 201 real hmin(ngrid) ! Ordonnée à l'origine pour le calcul de s2 202 real zmax_moy(ngrid) ! Hauteur moyenne des thermiques : zmax_moy = zlcl + 0.33 (zmax-zlcl) 203 real zmax_moy_coef 204 parameter(zmax_moy_coef=0.33) 205 real depth(klon) ! Epaisseur moyenne du cumulus 206 real w_max(klon) ! Vitesse max statistique 207 real s_max(klon) 208 !--Closure 209 real pbl_tke_max(klon,klev) ! Profil de TKE moyenne 210 real pbl_tke_max0(klon) ! TKE moyenne au LCL 211 real w_ls(klon,klev) ! Vitesse verticale grande échelle (m/s) 212 real coef_m ! On considère un rendement pour alp_bl_fluct_m 213 parameter(coef_m=1.) 214 real coef_tke ! On considère un rendement pour alp_bl_fluct_tke 215 parameter(coef_tke=1.) 216 217 !!! fin nrlmd le 10/04/2012 157 218 158 219 ! … … 679 740 enddo 680 741 ! 742 743 !!! nrlmd le 10/04/2012 744 745 !------------Test sur le LCL des thermiques 746 do ig=1,ngrid 747 ok_lcl(ig)=.false. 748 if ( (pcon(ig) .gt. pplay(ig,klev-1)) .and. (pcon(ig) .lt. pplay(ig,1)) ) ok_lcl(ig)=.true. 749 enddo 750 751 !------------Localisation des niveaux entourant le LCL et du coef d'interpolation 752 do l=1,nlay-1 753 do ig=1,ngrid 754 if (ok_lcl(ig)) then 755 if ((pplay(ig,l) .ge. pcon(ig)) .and. (pplay(ig,l+1) .le. pcon(ig))) then 756 klcl(ig)=l 757 interp(ig)=(pcon(ig)-pplay(ig,klcl(ig)))/(pplay(ig,klcl(ig)+1)-pplay(ig,klcl(ig))) 758 endif 759 endif 760 enddo 761 enddo 762 763 !------------Hauteur des thermiques 764 !!jyg le 27/04/2012 765 !! do ig =1,ngrid 766 !! rhobarz0(ig)=rhobarz(ig,klcl(ig))+(rhobarz(ig,klcl(ig)+1) & 767 !! & -rhobarz(ig,klcl(ig)))*interp(ig) 768 !! zlcl(ig)=(pplev(ig,1)-pcon(ig))/(rhobarz0(ig)*RG) 769 !! zmax(ig)=pphi(ig,lmax(ig))/rg 770 !! if ( (.not.ok_lcl(ig)) .or. (zlcl(ig).gt.zmax(ig)) ) zlcl(ig)=zmax(ig) ! Si zclc > zmax alors on pose zlcl = zmax 771 !! enddo 772 do ig =1,ngrid 773 zmax(ig)=pphi(ig,lmax(ig))/rg 774 if (ok_lcl(ig)) then 775 rhobarz0(ig)=rhobarz(ig,klcl(ig))+(rhobarz(ig,klcl(ig)+1) & 776 & -rhobarz(ig,klcl(ig)))*interp(ig) 777 zlcl(ig)=(pplev(ig,1)-pcon(ig))/(rhobarz0(ig)*RG) 778 zlcl(ig)=min(zlcl(ig),zmax(ig)) ! Si zlcl > zmax alors on pose zlcl = zmax 779 else 780 rhobarz0(ig)=0. 781 zlcl(ig)=zmax(ig) 782 endif 783 enddo 784 !!jyg fin 785 786 !------------Calcul des propriétés du thermique au LCL 787 IF ( (iflag_trig_bl.ge.1) .or. (iflag_clos_bl.ge.1) ) THEN 788 789 !-----Initialisation de la TKE moyenne 790 do l=1,nlay 791 do ig=1,ngrid 792 pbl_tke_max(ig,l)=0. 793 enddo 794 enddo 795 796 !-----Calcul de la TKE moyenne 797 do nsrf=1,nbsrf 798 do l=1,nlay 799 do ig=1,ngrid 800 pbl_tke_max(ig,l)=pctsrf(ig,nsrf)*pbl_tke(ig,l,nsrf)+pbl_tke_max(ig,l) 801 enddo 802 enddo 803 enddo 804 805 !-----Initialisations des TKE dans et hors des thermiques 806 do l=1,nlay 807 do ig=1,ngrid 808 therm_tke_max(ig,l)=pbl_tke_max(ig,l) 809 env_tke_max(ig,l)=pbl_tke_max(ig,l) 810 enddo 811 enddo 812 813 !-----Calcul de la TKE transportée par les thermiques : therm_tke_max 814 call thermcell_tke_transport(ngrid,nlay,ptimestep,fm0,entr0, & 815 & rg,pplev,therm_tke_max) 816 ! print *,' thermcell_tke_transport -> ' !!jyg 817 818 !-----Calcul des profils verticaux de TKE hors thermiques : env_tke_max, et de la vitesse verticale grande échelle : W_ls 819 do l=1,nlay 820 do ig=1,ngrid 821 pbl_tke_max(ig,l)=fraca(ig,l)*therm_tke_max(ig,l)+(1.-fraca(ig,l))*env_tke_max(ig,l) ! Recalcul de TKE moyenne aprés transport de TKE_TH 822 env_tke_max(ig,l)=(pbl_tke_max(ig,l)-fraca(ig,l)*therm_tke_max(ig,l))/(1.-fraca(ig,l)) ! Recalcul de TKE dans l'environnement aprés transport de TKE_TH 823 w_ls(ig,l)=-1.*omega(ig,l)/(RG*rhobarz(ig,l)) ! Vitesse verticale de grande échelle 824 enddo 825 enddo 826 ! print *,' apres w_ls = ' !!jyg 827 828 do ig=1,ngrid 829 if (ok_lcl(ig)) then 830 fraca0(ig)=fraca(ig,klcl(ig))+(fraca(ig,klcl(ig)+1) & 831 & -fraca(ig,klcl(ig)))*interp(ig) 832 w0(ig)=zw2(ig,klcl(ig))+(zw2(ig,klcl(ig)+1) & 833 & -zw2(ig,klcl(ig)))*interp(ig) 834 w_conv(ig)=w_ls(ig,klcl(ig))+(w_ls(ig,klcl(ig)+1) & 835 & -w_ls(ig,klcl(ig)))*interp(ig) 836 therm_tke_max0(ig)=therm_tke_max(ig,klcl(ig)) & 837 & +(therm_tke_max(ig,klcl(ig)+1)-therm_tke_max(ig,klcl(ig)))*interp(ig) 838 env_tke_max0(ig)=env_tke_max(ig,klcl(ig))+(env_tke_max(ig,klcl(ig)+1) & 839 & -env_tke_max(ig,klcl(ig)))*interp(ig) 840 pbl_tke_max0(ig)=pbl_tke_max(ig,klcl(ig))+(pbl_tke_max(ig,klcl(ig)+1) & 841 & -pbl_tke_max(ig,klcl(ig)))*interp(ig) 842 if (therm_tke_max0(ig).ge.20.) therm_tke_max0(ig)=20. 843 if (env_tke_max0(ig).ge.20.) env_tke_max0(ig)=20. 844 if (pbl_tke_max0(ig).ge.20.) pbl_tke_max0(ig)=20. 845 else 846 fraca0(ig)=0. 847 w0(ig)=0. 848 !!jyg le 27/04/2012 849 !! zlcl(ig)=0. 850 !! 851 endif 852 enddo 853 854 ENDIF ! IF ( (iflag_trig_bl.ge.1) .or. (iflag_clos_bl.ge.1) ) 855 ! print *,'ENDIF ( (iflag_trig_bl.ge.1) .or. (iflag_clos_bl.ge.1) ) ' !!jyg 856 857 !------------Triggering------------------ 858 IF (iflag_trig_bl.ge.1) THEN 859 860 !-----Initialisations 861 depth(:)=0. 862 n2(:)=0. 863 s2(:)=0. 864 s_max(:)=0. 865 866 !-----Epaisseur du nuage (depth) et détermination de la queue du spectre de panaches (n2,s2) et du panache le plus gros (s_max) 867 do ig=1,ngrid 868 zmax_moy(ig)=zlcl(ig)+zmax_moy_coef*(zmax(ig)-zlcl(ig)) 869 depth(ig)=zmax_moy(ig)-zlcl(ig) 870 hmin(ig)=hmincoef*zlcl(ig) 871 if (depth(ig).ge.10.) then 872 s2(ig)=(hcoef*depth(ig)+hmin(ig))**2 873 n2(ig)=(1.-eps1)*fraca0(ig)*airephy(ig)/s2(ig) 874 !! 875 !!jyg le 27/04/2012 876 !! s_max(ig)=s2(ig)*log(n2(ig)) 877 !! if (n2(ig) .lt. 1) s_max(ig)=0. 878 s_max(ig)=s2(ig)*log(max(n2(ig),1.)) 879 !!fin jyg 880 else 881 s2(ig)=0. 882 n2(ig)=0. 883 s_max(ig)=0. 884 endif 885 enddo 886 ! print *,'avant Calcul de Wmax ' !!jyg 887 888 !-----Calcul de Wmax et ALE_BL_STAT associée 889 !!jyg le 30/04/2012 890 !! do ig=1,ngrid 891 !! if ( (depth(ig).ge.10.) .and. (s_max(ig).gt.1.) ) then 892 !! w_max(ig)=w0(ig)*(1.+sqrt(2.*log(s_max(ig)/su)-log(2.*3.14)-log(2.*log(s_max(ig)/su)-log(2.*3.14)))) 893 !! ale_bl_stat(ig)=0.5*w_max(ig)**2 894 !! else 895 !! w_max(ig)=0. 896 !! ale_bl_stat(ig)=0. 897 !! endif 898 !! enddo 899 susqr2pi=su*sqrt(2.*Rpi) 900 Reuler=exp(1.) 901 do ig=1,ngrid 902 if ( (depth(ig).ge.10.) .and. (s_max(ig).gt.susqr2pi*Reuler) ) then 903 w_max(ig)=w0(ig)*(1.+sqrt(2.*log(s_max(ig)/susqr2pi)-log(2.*log(s_max(ig)/susqr2pi)))) 904 ale_bl_stat(ig)=0.5*w_max(ig)**2 905 else 906 w_max(ig)=0. 907 ale_bl_stat(ig)=0. 908 endif 909 enddo 910 911 ENDIF ! iflag_trig_bl 912 ! print *,'ENDIF iflag_trig_bl' !!jyg 913 914 !------------Closure------------------ 915 916 IF (iflag_clos_bl.ge.1) THEN 917 918 !-----Calcul de ALP_BL_STAT 919 do ig=1,ngrid 920 alp_bl_det(ig)=0.5*coef_m*rhobarz0(ig)*(w0(ig)**3)*fraca0(ig)*(1.-2.*fraca0(ig))/((1.-fraca0(ig))**2) 921 alp_bl_fluct_m(ig)=1.5*rhobarz0(ig)*fraca0(ig)*(w_conv(ig)+coef_m*w0(ig))* & 922 & (w0(ig)**2) 923 alp_bl_fluct_tke(ig)=3.*coef_m*rhobarz0(ig)*w0(ig)*fraca0(ig)*(therm_tke_max0(ig)-env_tke_max0(ig)) & 924 & +3.*rhobarz0(ig)*w_conv(ig)*pbl_tke_max0(ig) 925 if (iflag_clos_bl.ge.2) then 926 alp_bl_conv(ig)=1.5*coef_m*rhobarz0(ig)*fraca0(ig)*(fraca0(ig)/(1.-fraca0(ig)))*w_conv(ig)* & 927 & (w0(ig)**2) 928 else 929 alp_bl_conv(ig)=0. 930 endif 931 alp_bl_stat(ig)=alp_bl_det(ig)+alp_bl_fluct_m(ig)+alp_bl_fluct_tke(ig)+alp_bl_conv(ig) 932 enddo 933 934 !-----Sécurité ALP infinie 935 do ig=1,ngrid 936 if (fraca0(ig).gt.0.98) alp_bl_stat(ig)=2. 937 enddo 938 939 ENDIF ! (iflag_clos_bl.ge.1) 940 941 !!! fin nrlmd le 10/04/2012 942 681 943 if (prt_level.ge.10) then 682 944 ig=igout … … 858 1120 end 859 1121 1122 !!! nrlmd le 10/04/2012 Transport de la TKE par le thermique moyen pour la fermeture en ALP 1123 ! On transporte pbl_tke pour donner therm_tke 1124 ! Copie conforme de la subroutine DTKE dans physiq.F écrite par Frederic Hourdin 1125 subroutine thermcell_tke_transport(ngrid,nlay,ptimestep,fm0,entr0, & 1126 & rg,pplev,therm_tke_max) 1127 implicit none 1128 1129 #include "iniprint.h" 1130 !======================================================================= 1131 ! 1132 ! Calcul du transport verticale dans la couche limite en presence 1133 ! de "thermiques" explicitement representes 1134 ! calcul du dq/dt une fois qu'on connait les ascendances 1135 ! 1136 !======================================================================= 1137 1138 integer ngrid,nlay,nsrf 1139 1140 real ptimestep 1141 real masse0(ngrid,nlay),fm0(ngrid,nlay+1),pplev(ngrid,nlay+1) 1142 real entr0(ngrid,nlay),rg 1143 real therm_tke_max(ngrid,nlay) 1144 real detr0(ngrid,nlay) 1145 1146 1147 real masse(ngrid,nlay),fm(ngrid,nlay+1) 1148 real entr(ngrid,nlay) 1149 real q(ngrid,nlay) 1150 integer lev_out ! niveau pour les print 1151 1152 real qa(ngrid,nlay),detr(ngrid,nlay),wqd(ngrid,nlay+1) 1153 1154 real zzm 1155 1156 integer ig,k 1157 integer isrf 1158 1159 1160 lev_out=0 1161 1162 1163 if (prt_level.ge.1) print*,'Q2 THERMCEL_DQ 0' 1164 1165 ! calcul du detrainement 1166 do k=1,nlay 1167 detr0(:,k)=fm0(:,k)-fm0(:,k+1)+entr0(:,k) 1168 masse0(:,k)=(pplev(:,k)-pplev(:,k+1))/RG 1169 enddo 1170 1171 1172 ! Decalage vertical des entrainements et detrainements. 1173 masse(:,1)=0.5*masse0(:,1) 1174 entr(:,1)=0.5*entr0(:,1) 1175 detr(:,1)=0.5*detr0(:,1) 1176 fm(:,1)=0. 1177 do k=1,nlay-1 1178 masse(:,k+1)=0.5*(masse0(:,k)+masse0(:,k+1)) 1179 entr(:,k+1)=0.5*(entr0(:,k)+entr0(:,k+1)) 1180 detr(:,k+1)=0.5*(detr0(:,k)+detr0(:,k+1)) 1181 fm(:,k+1)=fm(:,k)+entr(:,k)-detr(:,k) 1182 enddo 1183 fm(:,nlay+1)=0. 1184 1185 !!! nrlmd le 16/09/2010 1186 ! calcul de la valeur dans les ascendances 1187 ! do ig=1,ngrid 1188 ! qa(ig,1)=q(ig,1) 1189 ! enddo 1190 !!! 1191 1192 !do isrf=1,nsrf 1193 1194 ! q(:,:)=therm_tke(:,:,isrf) 1195 q(:,:)=therm_tke_max(:,:) 1196 !!! nrlmd le 16/09/2010 1197 do ig=1,ngrid 1198 qa(ig,1)=q(ig,1) 1199 enddo 1200 !!! 1201 1202 if (1==1) then 1203 do k=2,nlay 1204 do ig=1,ngrid 1205 if ((fm(ig,k+1)+detr(ig,k))*ptimestep.gt. & 1206 & 1.e-5*masse(ig,k)) then 1207 qa(ig,k)=(fm(ig,k)*qa(ig,k-1)+entr(ig,k)*q(ig,k)) & 1208 & /(fm(ig,k+1)+detr(ig,k)) 1209 else 1210 qa(ig,k)=q(ig,k) 1211 endif 1212 if (qa(ig,k).lt.0.) then 1213 ! print*,'qa<0!!!' 1214 endif 1215 if (q(ig,k).lt.0.) then 1216 ! print*,'q<0!!!' 1217 endif 1218 enddo 1219 enddo 1220 1221 ! Calcul du flux subsident 1222 1223 do k=2,nlay 1224 do ig=1,ngrid 1225 wqd(ig,k)=fm(ig,k)*q(ig,k) 1226 if (wqd(ig,k).lt.0.) then 1227 ! print*,'wqd<0!!!' 1228 endif 1229 enddo 1230 enddo 1231 do ig=1,ngrid 1232 wqd(ig,1)=0. 1233 wqd(ig,nlay+1)=0. 1234 enddo 1235 1236 ! Calcul des tendances 1237 do k=1,nlay 1238 do ig=1,ngrid 1239 q(ig,k)=q(ig,k)+(detr(ig,k)*qa(ig,k)-entr(ig,k)*q(ig,k) & 1240 & -wqd(ig,k)+wqd(ig,k+1)) & 1241 & *ptimestep/masse(ig,k) 1242 enddo 1243 enddo 1244 1245 endif 1246 1247 therm_tke_max(:,:)=q(:,:) 1248 1249 return 1250 !!! fin nrlmd le 10/04/2012 1251 end 1252 -
LMDZ5/branches/testing/libf/phylmd/wake.F
r1403 r1669 561 561 ENDDO 562 562 563 c On evite kupper = 1 563 c On evite kupper = 1 et kupper = klev 564 564 DO i=1,klon 565 565 kupper(i) = max(kupper(i),2) 566 kupper(i) = min(kupper(i),klev-1) 566 567 ENDDO 567 568 -
LMDZ5/branches/testing/makegcm
r1665 r1669 23 23 set OPTIMI='-C debug -eC ' 24 24 set OPTIMI=' -ftrace ' 25 set OPT_LINUX="- O3 -fdefault-real-8"26 set OPT_LINUX="- O3 -fdefault-real-8"25 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 26 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 27 27 set io=ioipsl 28 28 set cosp=false 29 29 30 30 set FC_LINUX=g95 31 set FC_LINUX=g fortran32 #set FC_LINUX= pgf9031 set FC_LINUX=g95 32 #set FC_LINUX=g95 33 33 if ( $FC_LINUX == g95 ) then 34 set OPT_LINUX="- O3"34 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 35 35 else if ( $FC_LINUX == gfortran ) then 36 set OPT_LINUX="- fdefault-real-8 -O3"37 # set OPT_LINUX="- O3 -fno-second-underscore"38 set OPT_LINUX="- O3"36 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 37 # set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 38 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 39 39 else 40 40 # pgf90 options 41 set OPT_LINUX="-i4 - r8 -O2 -Munroll -Mnoframe -Mautoinline -Mcache_align"41 set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE" 42 42 endif 43 43 … … 54 54 setenv IOIPSLDIR /d4/fairhead/LMDZ20100928.trunk/modipsl/lib 55 55 setenv MODIPSLDIR /d4/fairhead/LMDZ20100928.trunk/modipsl/lib 56 setenv NCDFINC /d 4/fairhead/LMDZ20100928.trunk/netcdf-4.0.1/include57 setenv NCDFLIB /d 4/fairhead/LMDZ20100928.trunk/netcdf-4.0.1/lib56 setenv NCDFINC /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/include 57 setenv NCDFLIB /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/lib 58 58 59 59 … … 107 107 if ( ! $?NCDFLIB ) then 108 108 echo You must initialize the variable NCDFLIB in your environnement 109 echo for instance: "setenv NCDFLIB /d 4/fairhead/LMDZ20100928.trunk/netcdf-4.0.1/lib109 echo for instance: "setenv NCDFLIB /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/lib 110 110 exit 111 111 endif 112 112 if ( ! $?NCDFINC ) then 113 113 echo You must initialize the variable NCDFINC in your environnement 114 echo for instance: "setenv NCDFINC /d 4/fairhead/LMDZ20100928.trunk/netcdf-4.0.1/include114 echo for instance: "setenv NCDFINC /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/include 115 115 exit 116 116 endif … … 563 563 set lcosp="-lsxcosp " 564 564 endif 565 set opt_link="$lcosp $opt_link" 565 566 endif 566 567 … … 836 837 if ( $FC_LINUX == 'pgf90' ) then 837 838 if ( $io == "ioipsl" ) then 838 set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf "839 set opt_link=" $opt_link -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf " 839 840 else 840 set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf "841 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf " 841 842 endif 842 843 else if ($FC_LINUX == 'g95' || $FC_LINUX == 'gfortran' ) then 843 844 if ( $io == "ioipsl" ) then 844 set opt_link=" -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf "845 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf " 845 846 else 846 set opt_link=" -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lnetcdf "847 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lnetcdf " 847 848 endif 848 else849 set opt_link=" "850 849 endif 851 850 #################
Note: See TracChangeset
for help on using the changeset viewer.