[5f2e8f6] | 1 | !********************************************************************** |
---|
| 2 | ! Copyright 2016 * |
---|
| 3 | ! Andreas Stohl, Massimo Cassiani, Petra Seibert, A. Frank, * |
---|
| 4 | ! Gerhard Wotawa, Caroline Forster, Sabine Eckhardt, John Burkhart, * |
---|
| 5 | ! Harald Sodemann * |
---|
| 6 | ! * |
---|
| 7 | ! This file is part of FLEXPART-NorESM * |
---|
| 8 | ! * |
---|
| 9 | ! FLEXPART-NorESM is free software: you can redistribute it * |
---|
| 10 | ! and/or modify * |
---|
| 11 | ! it under the terms of the GNU General Public License as published by* |
---|
| 12 | ! the Free Software Foundation, either version 3 of the License, or * |
---|
| 13 | ! (at your option) any later version. * |
---|
| 14 | ! * |
---|
| 15 | ! FLEXPART-NorESM is distributed in the hope that it will be useful, * |
---|
| 16 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
| 17 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
---|
| 18 | ! GNU General Public License for more details. * |
---|
| 19 | ! * |
---|
| 20 | ! You should have received a copy of the GNU General Public License * |
---|
| 21 | ! along with FLEXPART-NorESM. * |
---|
| 22 | ! If not, see <http://www.gnu.org/licenses/>. * |
---|
| 23 | !********************************************************************** |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | !***************************************************************************** |
---|
| 27 | ! * |
---|
| 28 | ! These routines allocates temporary variables for reading netcdf input * |
---|
| 29 | ! files from NorESM * |
---|
| 30 | ! * |
---|
| 31 | ! Author: * |
---|
| 32 | ! M. Cassiani 2016 * |
---|
| 33 | ! * |
---|
| 34 | ! * |
---|
| 35 | !***************************************************************************** |
---|
| 36 | ! * |
---|
| 37 | ! Variables: * |
---|
| 38 | ! vartype type of variable * |
---|
| 39 | ! ndims number of dimensions 0,1,2,3 * |
---|
| 40 | ! lendim_exp expeceted elemnts in the dimension * |
---|
| 41 | ! * |
---|
| 42 | ! Constants: * |
---|
| 43 | ! * |
---|
| 44 | !***************************************************************************** |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | subroutine allocatedumarray1D(ndims,lendim_exp,maxdim) |
---|
| 49 | use noresm_variables |
---|
| 50 | integer maxdim |
---|
| 51 | integer ndims,lendim_exp(maxdim) |
---|
| 52 | |
---|
| 53 | if (allocated(dumarray1D)) deallocate(dumarray1D) |
---|
| 54 | allocate(dumarray1D(lendim_exp(1))) |
---|
| 55 | if (allocated(istart)) deallocate(istart) |
---|
| 56 | allocate(istart(ndims)) |
---|
| 57 | if (allocated(icount)) deallocate(icount) |
---|
| 58 | allocate(icount(ndims)) |
---|
| 59 | |
---|
| 60 | return |
---|
| 61 | end |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | subroutine allocatedumarray2D(ndims,lendim_exp,maxdim) |
---|
| 65 | use noresm_variables |
---|
| 66 | integer maxdim |
---|
| 67 | integer ndims,lendim_exp(maxdim) |
---|
| 68 | |
---|
| 69 | if (allocated(dumarray2D)) deallocate(dumarray2D) |
---|
| 70 | allocate(dumarray2D(lendim_exp(1),lendim_exp(2))) |
---|
| 71 | if (allocated(istart)) deallocate(istart) |
---|
| 72 | allocate(istart(ndims)) |
---|
| 73 | if (allocated(icount)) deallocate(icount) |
---|
| 74 | allocate(icount(ndims)) |
---|
| 75 | |
---|
| 76 | return |
---|
| 77 | end |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | subroutine allocatedumarray3D(ndims,lendim_exp,maxdim) |
---|
| 81 | use noresm_variables |
---|
| 82 | integer maxdim |
---|
| 83 | integer ndims,lendim_exp(maxdim) |
---|
| 84 | |
---|
| 85 | if (allocated(dumarray3D)) deallocate(dumarray3D) |
---|
| 86 | allocate(dumarray3D(lendim_exp(1),lendim_exp(2),lendim_exp(3))) |
---|
| 87 | if (allocated(istart)) deallocate(istart) |
---|
| 88 | allocate(istart(ndims)) |
---|
| 89 | if (allocated(icount)) deallocate(icount) |
---|
| 90 | allocate(icount(ndims)) |
---|
| 91 | |
---|
| 92 | return |
---|
| 93 | end |
---|
| 94 | |
---|
| 95 | subroutine allocatedumarray4D(ndims,lendim_exp,maxdim) |
---|
| 96 | use noresm_variables |
---|
| 97 | integer maxdim |
---|
| 98 | integer ndims,lendim_exp(maxdim) |
---|
| 99 | |
---|
| 100 | if (allocated(dumarray4D)) deallocate(dumarray4D) |
---|
| 101 | allocate(dumarray4D(lendim_exp(1),lendim_exp(2),lendim_exp(3),lendim_exp(4))) |
---|
| 102 | if (allocated(istart)) deallocate(istart) |
---|
| 103 | allocate(istart(ndims)) |
---|
| 104 | if (allocated(icount)) deallocate(icount) |
---|
| 105 | allocate(icount(ndims)) |
---|
| 106 | |
---|
| 107 | return |
---|
| 108 | end |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | subroutine allocatedumarray1D_real(ndims,lendim_exp,maxdim) |
---|
| 114 | use noresm_variables |
---|
| 115 | integer maxdim |
---|
| 116 | integer ndims,lendim_exp(maxdim) |
---|
| 117 | |
---|
| 118 | if (allocated(dumarray1D_real)) deallocate(dumarray1D_real) |
---|
| 119 | allocate(dumarray1D_real(lendim_exp(1))) |
---|
| 120 | if (allocated(istart)) deallocate(istart) |
---|
| 121 | allocate(istart(ndims)) |
---|
| 122 | if (allocated(icount)) deallocate(icount) |
---|
| 123 | allocate(icount(ndims)) |
---|
| 124 | |
---|
| 125 | return |
---|
| 126 | end |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | subroutine allocatedumarray2D_real(ndims,lendim_exp,maxdim) |
---|
| 130 | use noresm_variables |
---|
| 131 | integer maxdim |
---|
| 132 | integer ndims,lendim_exp(maxdim) |
---|
| 133 | |
---|
| 134 | if (allocated(dumarray2D_real)) deallocate(dumarray2D_real) |
---|
| 135 | allocate(dumarray2D_real(lendim_exp(1),lendim_exp(2))) |
---|
| 136 | if (allocated(istart)) deallocate(istart) |
---|
| 137 | allocate(istart(ndims)) |
---|
| 138 | if (allocated(icount)) deallocate(icount) |
---|
| 139 | allocate(icount(ndims)) |
---|
| 140 | |
---|
| 141 | return |
---|
| 142 | end |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | subroutine allocatedumarray3D_real(ndims,lendim_exp,maxdim) |
---|
| 146 | use noresm_variables |
---|
| 147 | integer maxdim |
---|
| 148 | integer ndims,lendim_exp(maxdim) |
---|
| 149 | |
---|
| 150 | if (allocated(dumarray3D_real)) deallocate(dumarray3D_real) |
---|
| 151 | allocate(dumarray3D_real(lendim_exp(1),lendim_exp(2),lendim_exp(3))) |
---|
| 152 | if (allocated(istart)) deallocate(istart) |
---|
| 153 | allocate(istart(ndims)) |
---|
| 154 | if (allocated(icount)) deallocate(icount) |
---|
| 155 | allocate(icount(ndims)) |
---|
| 156 | |
---|
| 157 | return |
---|
| 158 | end |
---|
| 159 | |
---|
| 160 | subroutine allocatedumarray4D_real(ndims,lendim_exp,maxdim) |
---|
| 161 | use noresm_variables |
---|
| 162 | integer maxdim |
---|
| 163 | integer ndims,lendim_exp(maxdim) |
---|
| 164 | |
---|
| 165 | if (allocated(dumarray4D_real)) deallocate(dumarray4D_real) |
---|
| 166 | allocate(dumarray4D_real(lendim_exp(1),lendim_exp(2),lendim_exp(3),lendim_exp(4))) |
---|
| 167 | if (allocated(istart)) deallocate(istart) |
---|
| 168 | allocate(istart(ndims)) |
---|
| 169 | if (allocated(icount)) deallocate(icount) |
---|
| 170 | allocate(icount(ndims)) |
---|
| 171 | |
---|
| 172 | return |
---|
| 173 | end |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | |
---|
| 177 | subroutine allocatedumarray1D_int(ndims,lendim_exp,maxdim) |
---|
| 178 | use noresm_variables |
---|
| 179 | integer maxdim |
---|
| 180 | integer ndims,lendim_exp(maxdim) |
---|
| 181 | |
---|
| 182 | if (allocated(dumarray1D_int)) deallocate(dumarray1D_int) |
---|
| 183 | allocate(dumarray1D_int(lendim_exp(1))) |
---|
| 184 | if (allocated(istart)) deallocate(istart) |
---|
| 185 | allocate(istart(ndims)) |
---|
| 186 | if (allocated(icount)) deallocate(icount) |
---|
| 187 | allocate(icount(ndims)) |
---|
| 188 | |
---|
| 189 | return |
---|
| 190 | end |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | subroutine allocatedumarray2D_int(ndims,lendim_exp,maxdim) |
---|
| 194 | use noresm_variables |
---|
| 195 | integer maxdim |
---|
| 196 | integer ndims,lendim_exp(maxdim) |
---|
| 197 | |
---|
| 198 | if (allocated(dumarray2D_int)) deallocate(dumarray2D_int) |
---|
| 199 | allocate(dumarray2D_int(lendim_exp(1),lendim_exp(2))) |
---|
| 200 | if (allocated(istart)) deallocate(istart) |
---|
| 201 | allocate(istart(ndims)) |
---|
| 202 | if (allocated(icount)) deallocate(icount) |
---|
| 203 | allocate(icount(ndims)) |
---|
| 204 | |
---|
| 205 | return |
---|
| 206 | end |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | subroutine allocatedumarray3D_int(ndims,lendim_exp,maxdim) |
---|
| 210 | use noresm_variables |
---|
| 211 | integer maxdim |
---|
| 212 | integer ndims,lendim_exp(maxdim) |
---|
| 213 | |
---|
| 214 | if (allocated(dumarray3D_int)) deallocate(dumarray3D_int) |
---|
| 215 | allocate(dumarray3D_int(lendim_exp(1),lendim_exp(2),lendim_exp(3))) |
---|
| 216 | if (allocated(istart)) deallocate(istart) |
---|
| 217 | allocate(istart(ndims)) |
---|
| 218 | if (allocated(icount)) deallocate(icount) |
---|
| 219 | allocate(icount(ndims)) |
---|
| 220 | |
---|
| 221 | return |
---|
| 222 | end |
---|
| 223 | |
---|
| 224 | |
---|
| 225 | |
---|
| 226 | subroutine allocatedumarray1D_char(ndims,lendim_exp,maxdim) |
---|
| 227 | use noresm_variables |
---|
| 228 | integer maxdim |
---|
| 229 | integer ndims,lendim_exp(maxdim) |
---|
| 230 | |
---|
| 231 | if (allocated(dumarray1D_char)) deallocate(dumarray1D_char) |
---|
| 232 | allocate(dumarray1D_char(lendim_exp(1))) |
---|
| 233 | if (allocated(istart)) deallocate(istart) |
---|
| 234 | allocate(istart(ndims)) |
---|
| 235 | if (allocated(icount)) deallocate(icount) |
---|
| 236 | allocate(icount(ndims)) |
---|
| 237 | |
---|
| 238 | return |
---|
| 239 | end |
---|
| 240 | |
---|
| 241 | subroutine allocatedumarray2D_char(ndims,lendim_exp,maxdim) |
---|
| 242 | use noresm_variables |
---|
| 243 | integer maxdim |
---|
| 244 | integer ndims,lendim_exp(maxdim) |
---|
| 245 | |
---|
| 246 | if (allocated(dumarray2D_char)) deallocate(dumarray2D_char) |
---|
| 247 | allocate(dumarray2D_char(lendim_exp(1),lendim_exp(2))) |
---|
| 248 | if (allocated(istart)) deallocate(istart) |
---|
| 249 | allocate(istart(ndims)) |
---|
| 250 | if (allocated(icount)) deallocate(icount) |
---|
| 251 | allocate(icount(ndims)) |
---|
| 252 | |
---|
| 253 | return |
---|
| 254 | end |
---|