Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heterogenous standard deviation for perturbation input from file #628

Merged
merged 6 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ subroutine get_pert_grid( tile_grid, pert_grid )
else ! cubed-sphere grid
!for cubed-sphere grid, global lat_lon grid
N_x=tile_grid%n_lon

! NOTE: the grid specification is hard-wired here,
! if perturbation sdv is heterogeous input from a file
! the input grid must match this grid (sqz 2/2023)
n_lon=4*N_x
n_lat=3*N_x
write(lattmp,'(I6.6)') n_lat
Expand Down Expand Up @@ -1111,6 +1113,8 @@ subroutine get_force_pert_inputs( pert_grid_l, &
call MPI_BCAST(stdfilename_force_pert,300,MPI_CHARACTER,0,mpicomm,mpierr)

nc4_file = stdfilename_force_pert
! NOTE: the input file is in netcdf, with a group 'std_force_pert',
! and the grid is same as *global* grid (tile_grid_g) (sqz 2/2023)

! --compute-local-shape-first-
! ASSUMPTION: data in file are on the *global* grid (tile_grid_g)
Expand Down Expand Up @@ -1150,11 +1154,11 @@ subroutine get_force_pert_inputs( pert_grid_l, &
)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
! get _FillValue for nc4_varname
nc4_stat = nf90_get_att(nc4_grpid, nc4_varid, '_FillValue', nc4_fillval)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
!nc4_stat = nf90_get_att(nc4_grpid, nc4_varid, '_FillValue', nc4_fillval)
!if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
! replace _FillValue by zero
where (abs(std_force_pert(ivar,:,:)-nc4_fillval)<nodata_tolfrac_generic) &
std_force_pert(ivar,:,:) = 0.
!where (abs(std_force_pert(ivar,:,:)-nc4_fillval)<nodata_tolfrac_generic) &
! std_force_pert(ivar,:,:) = 0.
end if
end do
end if
Expand Down Expand Up @@ -1503,6 +1507,8 @@ subroutine get_progn_pert_inputs( pert_grid_l, &
call MPI_BCAST(stdfilename_progn_pert,300,MPI_CHARACTER,0,mpicomm,mpierr)

nc4_file = stdfilename_progn_pert
! NOTE: the input file is in netcdf, with a group 'std_progn_pert',
! and the grid is same as *global* grid (tile_grid_g) (sqz 2/2023)

! --compute-local-shape-first-
! ASSUMPTION: data in file are on the *global* grid (tile_grid_g)
Expand Down Expand Up @@ -1542,17 +1548,17 @@ subroutine get_progn_pert_inputs( pert_grid_l, &
)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
! get _FillValue for nc4_varname
nc4_stat = nf90_get_att(nc4_grpid, nc4_varid, '_FillValue', nc4_fillval)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
!nc4_stat = nf90_get_att(nc4_grpid, nc4_varid, '_FillValue', nc4_fillval)
!if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
! replace _FillValue by zero
where (abs(std_progn_pert(ivar,:,:)-nc4_fillval)<nodata_tolfrac_generic) &
std_progn_pert(ivar,:,:) = 0.
!where (abs(std_progn_pert(ivar,:,:)-nc4_fillval)<nodata_tolfrac_generic) &
!std_progn_pert(ivar,:,:) = 0.
end if
end do
! close file
nc4_stat = nf90_close(nc4_id)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
end if
! close file
nc4_stat = nf90_close(nc4_id)
if (nc4_stat /= nf90_noerr) call handle_nc4_stat(nc4_stat)
end do
call MPI_Barrier(mpicomm, mpierr)
end if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ subroutine LDAS_create_grid_g( gridname, n_lon, n_lat, &

if (date_line_on_center) then

tile_grid%ll_lon = -180. - tile_grid%dlon/2.
tile_grid%ll_lon = -180. + tile_grid%dlon/2. ! fixed sign (sqz 2023)
tile_grid%ur_lon = 180. - tile_grid%dlon/2. ! fixed 20 sep 2010, reichle

else
Expand Down