Skip to content

Commit

Permalink
bug fix in OPAQ variables (#15)
Browse files Browse the repository at this point in the history
* bug fix on OPAQ variables

* DEBUG comments erased
  • Loading branch information
rodrigoguzman-lmd authored and dustinswales committed Nov 28, 2018
1 parent d16ea15 commit 27851f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions driver/src/cosp2_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
endif
if (associated(cospOUT%calipso_cldtypemeanz)) then
! Opaque cloud temperature
! Opaque cloud altitude
status = nf90_def_var(fileID,"clopaquemeanz",nf90_float, (/dimID(1)/),varID(101))
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(101),"long_name","CALIPSO Opaque Cloud Altitude")
Expand All @@ -577,7 +577,7 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(101),"standard_name", "opaque_cloud_altitude")
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
! Thin cloud temperature
! Thin cloud altitude
status = nf90_def_var(fileID,"clthinmeanz",nf90_float, (/dimID(1)/),varID(102))
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(102),"long_name","CALIPSO Thin Cloud Altitude")
Expand Down Expand Up @@ -608,7 +608,7 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(104),"standard_name", "opaque_cloud_altitude_se")
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
! Thin cloud
! Thin cloud altitude with respect to Surface Elevation
status = nf90_def_var(fileID,"clthinmeanzse",nf90_float, (/dimID(1)/),varID(105))
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(105),"long_name","CALIPSO Thin Cloud Altitude with respect to SE")
Expand All @@ -617,7 +617,7 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(105),"standard_name", "thin_cloud_altitude_se")
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
! z_opaque
! z_opaque altitude with respect to Surface Elevation
status = nf90_def_var(fileID,"clzopaquecalipsose",nf90_float, (/dimID(1)/),varID(106))
if (status .ne. nf90_NoERR) print*,trim(nf90_strerror(status))
status = nf90_put_att(fileID,varID(106),"long_name","CALIPSO z_opaque Altitude with respect to SE")
Expand Down
4 changes: 2 additions & 2 deletions src/simulator/actsim/lidar_simulator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ SUBROUTINE COSP_OPAQ(Npoints,Ncolumns,Nlevels,Ntype,tmp,x,S_att,S_cld,undef,lida
cldy(:,:,k)=0._wp
endwhere
! Fully attenuated layer detection at subgrid-scale:
where ( (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .gt. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG
where ( (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) )
cldyopaq(:,:,k)=1._wp
elsewhere
cldyopaq(:,:,k)=0._wp
Expand All @@ -1363,7 +1363,7 @@ SUBROUTINE COSP_OPAQ(Npoints,Ncolumns,Nlevels,Ntype,tmp,x,S_att,S_cld,undef,lida
srok(:,:,k)=0._wp
endwhere
! Number of usefull sub-columns layers for z_opaque 3D fraction:
where ( (x(:,:,k) .gt. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG
where ( (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) )
srokopaq(:,:,k)=1._wp
elsewhere
srokopaq(:,:,k)=0._wp
Expand Down

0 comments on commit 27851f0

Please sign in to comment.