Changeset 3295
- Timestamp:
- Mar 23, 2018, 11:39:51 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/mo_simple_plumes.F90
r3290 r3295 36 36 LOGICAL, SAVE :: & 37 37 sp_initialized = .FALSE. !< parameter determining whether input needs to be read 38 !$OMP THREADPRIVATE(sp_initialized) 38 39 39 40 REAL :: & … … 57 58 year_weight (nyears,nplumes) ,& !< Yearly weight for plume 58 59 ann_cycle (nfeatures,ntimes,nplumes) !< annual cycle for plume feature 60 !$OMP THREADPRIVATE(plume_lat,plume_lon,beta_a,beta_b,aod_spmx,aod_fmbg,asy550,ssa550,angstrom) 61 !$OMP THREADPRIVATE(sig_lon_E,sig_lon_W,sig_lat_E,sig_lat_W,theta,ftr_weight,year_weight,ann_cycle) 59 62 60 63 PUBLIC sp_aop_profile … … 68 71 SUBROUTINE sp_setup 69 72 ! 73 USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root 74 USE mod_phys_lmdz_omp_data, ONLY: is_omp_root 75 ! 70 76 ! ---------- 71 77 ! … … 73 79 ! 74 80 ! ---------- 75 ! 76 iret = nf90_open("MACv2.0-SP_v1.nc", NF90_NOWRITE, ncid) 77 IF (iret /= NF90_NOERR) STOP 'NetCDF File not opened' 78 ! 79 ! read dimensions and make sure file conforms to expected size 80 ! 81 iret = nf90_inq_dimid(ncid, "plume_number" , DimId) 82 iret = nf90_inquire_dimension(ncid, DimId, len = xdmy) 83 IF (xdmy /= nplumes) STOP 'NetCDF improperly dimensioned -- plume_number' 84 85 iret = nf90_inq_dimid(ncid, "plume_feature", DimId) 86 iret = nf90_inquire_dimension(ncid, DimId, len = xdmy) 87 IF (xdmy /= nfeatures) STOP 'NetCDF improperly dimensioned -- plume_feature' 88 89 iret = nf90_inq_dimid(ncid, "year_fr" , DimId) 90 iret = nf90_inquire_dimension(ncid, DimID, len = xdmy) 91 IF (xdmy /= ntimes) STOP 'NetCDF improperly dimensioned -- year_fr' 92 93 iret = nf90_inq_dimid(ncid, "years" , DimId) 94 iret = nf90_inquire_dimension(ncid, DimID, len = xdmy) 95 IF (xdmy /= nyears) STOP 'NetCDF improperly dimensioned -- years' 96 ! 97 ! read variables that define the simple plume climatology 98 ! 99 iret = nf90_inq_varid(ncid, "plume_lat", VarId) 100 iret = nf90_get_var(ncid, VarID, plume_lat(:), start=(/1/),count=(/nplumes/)) 101 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat' 102 iret = nf90_inq_varid(ncid, "plume_lon", VarId) 103 iret = nf90_get_var(ncid, VarID, plume_lon(:), start=(/1/),count=(/nplumes/)) 104 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lon' 105 iret = nf90_inq_varid(ncid, "beta_a" , VarId) 106 iret = nf90_get_var(ncid, VarID, beta_a(:) , start=(/1/),count=(/nplumes/)) 107 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_a' 108 iret = nf90_inq_varid(ncid, "beta_b" , VarId) 109 iret = nf90_get_var(ncid, VarID, beta_b(:) , start=(/1/),count=(/nplumes/)) 110 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_b' 111 iret = nf90_inq_varid(ncid, "aod_spmx" , VarId) 112 iret = nf90_get_var(ncid, VarID, aod_spmx(:) , start=(/1/),count=(/nplumes/)) 113 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_spmx' 114 iret = nf90_inq_varid(ncid, "aod_fmbg" , VarId) 115 iret = nf90_get_var(ncid, VarID, aod_fmbg(:) , start=(/1/),count=(/nplumes/)) 116 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_fmbg' 117 iret = nf90_inq_varid(ncid, "ssa550" , VarId) 118 iret = nf90_get_var(ncid, VarID, ssa550(:) , start=(/1/),count=(/nplumes/)) 119 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ssa550' 120 iret = nf90_inq_varid(ncid, "asy550" , VarId) 121 iret = nf90_get_var(ncid, VarID, asy550(:) , start=(/1/),count=(/nplumes/)) 122 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading asy550' 123 iret = nf90_inq_varid(ncid, "angstrom" , VarId) 124 iret = nf90_get_var(ncid, VarID, angstrom(:), start=(/1/),count=(/nplumes/)) 125 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading angstrom' 126 127 iret = nf90_inq_varid(ncid, "sig_lat_W" , VarId) 128 iret = nf90_get_var(ncid, VarID, sig_lat_W(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 129 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_W' 130 iret = nf90_inq_varid(ncid, "sig_lat_E" , VarId) 131 iret = nf90_get_var(ncid, VarID, sig_lat_E(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 132 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_E' 133 iret = nf90_inq_varid(ncid, "sig_lon_E" , VarId) 134 iret = nf90_get_var(ncid, VarID, sig_lon_E(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 135 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_E' 136 iret = nf90_inq_varid(ncid, "sig_lon_W" , VarId) 137 iret = nf90_get_var(ncid, VarID, sig_lon_W(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 138 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_W' 139 iret = nf90_inq_varid(ncid, "theta" , VarId) 140 iret = nf90_get_var(ncid, VarID, theta(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 141 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading theta' 142 iret = nf90_inq_varid(ncid, "ftr_weight" , VarId) 143 iret = nf90_get_var(ncid, VarID, ftr_weight(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 144 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat' 145 iret = nf90_inq_varid(ncid, "year_weight" , VarId) 146 iret = nf90_get_var(ncid, VarID, year_weight(:,:) , start=(/1,1/),count=(/nyears,nplumes /)) 147 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading year_weight' 148 iret = nf90_inq_varid(ncid, "ann_cycle" , VarId) 149 iret = nf90_get_var(ncid, VarID, ann_cycle(:,:,:) , start=(/1,1,1/),count=(/nfeatures,ntimes,nplumes/)) 150 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ann_cycle' 151 152 iret = nf90_close(ncid) 153 81 !--only one processor reads the input data 82 IF (is_mpi_root.AND.is_omp_root) THEN 83 ! 84 iret = nf90_open("MACv2.0-SP_v1.nc", NF90_NOWRITE, ncid) 85 IF (iret /= NF90_NOERR) STOP 'NetCDF File not opened' 86 ! 87 ! read dimensions and make sure file conforms to expected size 88 ! 89 iret = nf90_inq_dimid(ncid, "plume_number" , DimId) 90 iret = nf90_inquire_dimension(ncid, DimId, len = xdmy) 91 IF (xdmy /= nplumes) STOP 'NetCDF improperly dimensioned -- plume_number' 92 ! 93 iret = nf90_inq_dimid(ncid, "plume_feature", DimId) 94 iret = nf90_inquire_dimension(ncid, DimId, len = xdmy) 95 IF (xdmy /= nfeatures) STOP 'NetCDF improperly dimensioned -- plume_feature' 96 ! 97 iret = nf90_inq_dimid(ncid, "year_fr" , DimId) 98 iret = nf90_inquire_dimension(ncid, DimID, len = xdmy) 99 IF (xdmy /= ntimes) STOP 'NetCDF improperly dimensioned -- year_fr' 100 ! 101 iret = nf90_inq_dimid(ncid, "years" , DimId) 102 iret = nf90_inquire_dimension(ncid, DimID, len = xdmy) 103 IF (xdmy /= nyears) STOP 'NetCDF improperly dimensioned -- years' 104 ! 105 ! read variables that define the simple plume climatology 106 ! 107 iret = nf90_inq_varid(ncid, "plume_lat", VarId) 108 iret = nf90_get_var(ncid, VarID, plume_lat(:), start=(/1/),count=(/nplumes/)) 109 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat' 110 iret = nf90_inq_varid(ncid, "plume_lon", VarId) 111 iret = nf90_get_var(ncid, VarID, plume_lon(:), start=(/1/),count=(/nplumes/)) 112 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lon' 113 iret = nf90_inq_varid(ncid, "beta_a" , VarId) 114 iret = nf90_get_var(ncid, VarID, beta_a(:) , start=(/1/),count=(/nplumes/)) 115 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_a' 116 iret = nf90_inq_varid(ncid, "beta_b" , VarId) 117 iret = nf90_get_var(ncid, VarID, beta_b(:) , start=(/1/),count=(/nplumes/)) 118 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_b' 119 iret = nf90_inq_varid(ncid, "aod_spmx" , VarId) 120 iret = nf90_get_var(ncid, VarID, aod_spmx(:) , start=(/1/),count=(/nplumes/)) 121 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_spmx' 122 iret = nf90_inq_varid(ncid, "aod_fmbg" , VarId) 123 iret = nf90_get_var(ncid, VarID, aod_fmbg(:) , start=(/1/),count=(/nplumes/)) 124 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_fmbg' 125 iret = nf90_inq_varid(ncid, "ssa550" , VarId) 126 iret = nf90_get_var(ncid, VarID, ssa550(:) , start=(/1/),count=(/nplumes/)) 127 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ssa550' 128 iret = nf90_inq_varid(ncid, "asy550" , VarId) 129 iret = nf90_get_var(ncid, VarID, asy550(:) , start=(/1/),count=(/nplumes/)) 130 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading asy550' 131 iret = nf90_inq_varid(ncid, "angstrom" , VarId) 132 iret = nf90_get_var(ncid, VarID, angstrom(:), start=(/1/),count=(/nplumes/)) 133 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading angstrom' 134 ! 135 iret = nf90_inq_varid(ncid, "sig_lat_W" , VarId) 136 iret = nf90_get_var(ncid, VarID, sig_lat_W(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 137 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_W' 138 iret = nf90_inq_varid(ncid, "sig_lat_E" , VarId) 139 iret = nf90_get_var(ncid, VarID, sig_lat_E(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 140 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_E' 141 iret = nf90_inq_varid(ncid, "sig_lon_E" , VarId) 142 iret = nf90_get_var(ncid, VarID, sig_lon_E(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 143 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_E' 144 iret = nf90_inq_varid(ncid, "sig_lon_W" , VarId) 145 iret = nf90_get_var(ncid, VarID, sig_lon_W(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 146 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_W' 147 iret = nf90_inq_varid(ncid, "theta" , VarId) 148 iret = nf90_get_var(ncid, VarID, theta(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 149 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading theta' 150 iret = nf90_inq_varid(ncid, "ftr_weight" , VarId) 151 iret = nf90_get_var(ncid, VarID, ftr_weight(:,:) , start=(/1,1/),count=(/nfeatures,nplumes/)) 152 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat' 153 iret = nf90_inq_varid(ncid, "year_weight" , VarId) 154 iret = nf90_get_var(ncid, VarID, year_weight(:,:) , start=(/1,1/),count=(/nyears,nplumes /)) 155 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading year_weight' 156 iret = nf90_inq_varid(ncid, "ann_cycle" , VarId) 157 iret = nf90_get_var(ncid, VarID, ann_cycle(:,:,:) , start=(/1,1,1/),count=(/nfeatures,ntimes,nplumes/)) 158 IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ann_cycle' 159 ! 160 iret = nf90_close(ncid) 161 ! 162 ENDIF !--root processor 163 ! 164 CALL bcast(plume_lat) 165 CALL bcast(plume_lon) 166 CALL bcast(beta_a) 167 CALL bcast(beta_b) 168 CALL bcast(aod_spmx) 169 CALL bcast(aod_fmbg) 170 CALL bcast(asy550) 171 CALL bcast(ssa550) 172 CALL bcast(angstrom) 173 CALL bcast(sig_lon_E) 174 CALL bcast(sig_lon_W) 175 CALL bcast(sig_lat_E) 176 CALL bcast(sig_lat_W) 177 CALL bcast(theta) 178 CALL bcast(ftr_weight) 179 CALL bcast(year_weight) 180 CALL bcast(ann_cycle) 181 ! 154 182 sp_initialized = .TRUE. 155 183 ! 156 184 RETURN 185 ! 157 186 END SUBROUTINE sp_setup 158 187 !
Note: See TracChangeset
for help on using the changeset viewer.