Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache: 'pip'

- name: Install pip packages
run: pip install fortitude-lint
run: pip install fortitude-lint==0.9.0

#TODO: Checking only the interface, could also be interesting to use
#for src/ and PR into main PDAF
Expand Down
8 changes: 4 additions & 4 deletions interface/framework/add_obs_error_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ SUBROUTINE add_obs_error_pdaf(step, dim_obs, C_p)
if(multierr/=1) then
DO i = 1, dim_obs
C_p(i, i) = C_p(i, i) + variance_obs
ENDDO
endif
END DO
end if


if(multierr==1) then
Expand All @@ -110,7 +110,7 @@ SUBROUTINE add_obs_error_pdaf(step, dim_obs, C_p)
#else
C_p(i,i) = C_p(i,i) + pressure_obserr(obs_pdaf2nc(i))*pressure_obserr(obs_pdaf2nc(i))
#endif
enddo
endif
end do
end if

END SUBROUTINE add_obs_error_pdaf
12 changes: 6 additions & 6 deletions interface/framework/assimilate_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ SUBROUTINE assimilate_pdaf()
init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_ens_pdaf, &
localize_covar_pdafomi, next_observation_pdaf, status_pdaf)

ELSEIF (filtertype == 2) then ! non diagonal R for EnKF has its own callback routine
ELSE IF (filtertype == 2) then ! non diagonal R for EnKF has its own callback routine
CALL PDAFomi_assimilate_enkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, &
init_dim_obs_pdafomi, obs_op_pdafomi, add_obs_err_pdafomi, init_obscovar_pdafomi, &
prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf)
Expand All @@ -164,9 +164,9 @@ SUBROUTINE assimilate_pdaf()
init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, &
prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf)

ENDIF
END IF

ENDIF
END IF
#endif
ELSE OMI

Expand Down Expand Up @@ -245,9 +245,9 @@ SUBROUTINE assimilate_pdaf()
! Check for errors during execution of PDAF

IF (status_pdaf /= 0) THEN
WRITE (*,'(/1x,a6,i3,a43,i4,a1/)') &
'ERROR ', status_pdaf, &
' in PDAF_assimilate - stopping! (PE ', mype_world,')'
WRITE (*,"(/1x,a6,i3,a43,i4,a1/)") &
"ERROR ", status_pdaf, &
" in PDAF_assimilate - stopping! (PE ", mype_world,")"
CALL abort_parallel()
END IF

Expand Down
8 changes: 4 additions & 4 deletions interface/framework/callback_obs_pdafomi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ SUBROUTINE init_dim_obs_pdafomi(step, dim_obs)
! in which order they are called

if (mype_world==0 .and. screen > 2) then
write(*,*)'Call dimension initialization'
write(*,*)"Call dimension initialization"
end if

#ifdef PDAF_DEBUG
if (mype_world==0) then
write(*,*)'PDAF-OMI-DEBUG: assim_GRACE=', assim_GRACE
write(*,*)'PDAF-OMI-DEBUG: assim_SM=', assim_SM
write(*,*)"PDAF-OMI-DEBUG: assim_GRACE=", assim_GRACE
write(*,*)"PDAF-OMI-DEBUG: assim_SM=", assim_SM
! write(*,*)'PDAF-OMI assim_C=', assim_C
end if
#endif
Expand Down Expand Up @@ -134,7 +134,7 @@ SUBROUTINE obs_op_pdafomi(step, dim_p, dim_obs, state_p, ostate)
! order of the calls in init_dim_obs_pdafomi

if (mype_world==0 .and. screen > 2) then
write(*,*)'Call observation operators'
write(*,*)"Call observation operators"
end if

IF (assim_GRACE) CALL obs_op_GRACE(dim_p, dim_obs, state_p, ostate)
Expand Down
2 changes: 1 addition & 1 deletion interface/framework/collect_state_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ SUBROUTINE collect_state_pdaf(dim_p, state_p)
#ifdef PDAF_DEBUG
! Debug output: Collected state array
DO i = 1, MIN(dim_p,6)
WRITE(*, '(a,x,a,i5,x,a,i1,a,x,f12.8)') "TSMP-PDAF-debug", "mype(w)=", mype_world, &
WRITE(*, "(a,x,a,i5,x,a,i1,a,x,f12.8)") "TSMP-PDAF-debug", "mype(w)=", mype_world, &
"collect_state_pdaf: state_p(", i, "):", state_p(i)
END DO
#endif
Expand Down
2 changes: 1 addition & 1 deletion interface/framework/distribute_state_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SUBROUTINE distribute_state_pdaf(dim_p, state_p)
#ifdef PDAF_DEBUG
! Debug output: Distributed state array
DO i = 1, MIN(dim_p,6)
WRITE(*, '(a,x,a,i5,x,a,i1,a,x,f12.8)') "TSMP-PDAF-debug", "mype(w)=", mype_world, &
WRITE(*, "(a,x,a,i5,x,a,i1,a,x,f12.8)") "TSMP-PDAF-debug", "mype(w)=", mype_world, &
"distribute_state_pdaf: state_p(", i, "):", state_p(i)
END DO
#endif
Expand Down
2 changes: 1 addition & 1 deletion interface/framework/distribute_stateinc_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SUBROUTINE distribute_stateinc_pdaf(dim_p, state_inc_p, new_forecast, steps)
! At begin of each forecast phase distribute full increment to
! all processes and compute increment per update step.
! (E.g., at each time step)
ENDIF
END IF


! *************************************
Expand Down
2 changes: 1 addition & 1 deletion interface/framework/g2l_state_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l)
DO i = 0, dim_l-1
nshift_p = domain_p + i * n_domain
state_l(i+1) = state_p(nshift_p)
ENDDO
END DO
else if (model == tag_model_clm) then
state_l(dim_l) = state_p(domain_p)
end if
Expand Down
36 changes: 18 additions & 18 deletions interface/framework/init_dim_obs_f_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
is_multi_observation_files = .true.
if (is_multi_observation_files) then
! Set name of current NetCDF observation file
write(current_observation_filename, '(a, i5.5)') trim(obs_filename)//'.', step
write(current_observation_filename, "(a, i5.5)") trim(obs_filename)//".", step
else
! Single NetCDF observation file (currently NOT used)
write(current_observation_filename, '(a, i5.5)') trim(obs_filename)
write(current_observation_filename, "(a, i5.5)") trim(obs_filename)
end if

if (mype_filter == 0) then
Expand All @@ -238,7 +238,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(point_obs==0) then
call mpi_bcast(dim_nx, 1, MPI_INTEGER, 0, comm_filter, ierror)
call mpi_bcast(dim_ny, 1, MPI_INTEGER, 0, comm_filter, ierror)
endif
end if
! broadcast damping factor flags
call mpi_bcast(is_dampfac_state_time_dependent, 1, MPI_INTEGER, 0, comm_filter, ierror)
call mpi_bcast(is_dampfac_param_time_dependent, 1, MPI_INTEGER, 0, comm_filter, ierror)
Expand Down Expand Up @@ -311,7 +311,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if (multierr==1) then
if (allocated(pressure_obserr)) deallocate(pressure_obserr)
allocate(pressure_obserr(dim_obs))
endif
end if
if(allocated(idx_obs_nc)) deallocate(idx_obs_nc)
allocate(idx_obs_nc(dim_obs))
if(allocated(x_idx_obs_nc))deallocate(x_idx_obs_nc)
Expand All @@ -329,7 +329,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(point_obs==0) then
if(allocated(var_id_obs_nc))deallocate(var_id_obs_nc)
allocate(var_id_obs_nc(dim_ny, dim_nx))
endif
end if
!end if
#endif
#endif
Expand All @@ -351,7 +351,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(point_obs==0) then
if(allocated(var_id_obs_nc)) deallocate(var_id_obs_nc)
allocate(var_id_obs_nc(dim_ny, dim_nx))
endif
end if
if(multierr==1) then
if(allocated(clm_obserr)) deallocate(clm_obserr)
allocate(clm_obserr(dim_obs))
Expand Down Expand Up @@ -699,14 +699,14 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(multierr==1) then
if (allocated(pressure_obserr_p)) deallocate(pressure_obserr_p)
allocate(pressure_obserr_p(dim_obs_p))
endif
end if

if(crns_flag==1) then
if (allocated(sc_p)) deallocate(sc_p)
allocate(sc_p(nz_glob, dim_obs_p))
if (allocated(idx_obs_nc_p)) deallocate(idx_obs_nc_p)
allocate(idx_obs_nc_p(dim_obs_p))
endif
end if
!hcp fin

if (point_obs==0) then
Expand Down Expand Up @@ -770,7 +770,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
!hcp
if(crns_flag==1) then
idx_obs_nc(:)=nx_glob*(y_idx_obs_nc(:)-1)+x_idx_obs_nc(:)
endif
end if
!hcp fin
cnt = 1
do i = 1, dim_obs
Expand All @@ -787,7 +787,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(crns_flag==1) then
idx_obs_nc_p(cnt)=idx_obs_nc(i)
!Allocate(sc_p(cnt)%scol_obs_in(nz_glob))
endif
end if
cnt = cnt + 1
end if
end do
Expand All @@ -798,10 +798,10 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
k_cnt=idx_obs_nc_p(i)+(k-1)*nx_glob*ny_glob
do j = 1, enkf_subvecsize
if (k_cnt == idx_map_subvec2state_fortran(j)) sc_p(nz_glob-k+1,i)=j
enddo
enddo
endif
enddo
end do
end do
end if
end do

if(obs_interp_switch==1) then
! loop over all obs and save the indices of the nearest grid
Expand Down Expand Up @@ -873,7 +873,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
if(multierr==1) then
if (allocated(clm_obserr_p)) deallocate(clm_obserr_p)
allocate(clm_obserr_p(dim_obs_p))
endif
end if
if(point_obs==0) then
max_var_id = MAXVAL(var_id_obs_nc(:,:))
if(allocated(lon_var_id)) deallocate(lon_var_id)
Expand Down Expand Up @@ -909,8 +909,8 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
lon_var_id(j) = (maxlon(j) + minlon(j))/2.0
lat_var_id(j) = (maxlat(j) + minlat(j))/2.0
!print *, 'j lon_var_id lat_var_id ', j, lon_var_id(j), lat_var_id(j)
enddo ! allocate clm_obserr_p observation error for clm run at PE-local domain
enddo
end do ! allocate clm_obserr_p observation error for clm run at PE-local domain
end do

cnt = 1
do m = 1, dim_nx
Expand All @@ -924,7 +924,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f)
var_id_obs(cnt) = var_id_obs_nc(l,m)
if(multierr==1) clm_obserr_p(cnt) = clm_obserr(i)
cnt = cnt + 1
endif
end if
end do
end do
end do
Expand Down
14 changes: 7 additions & 7 deletions interface/framework/init_dim_obs_l_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ SUBROUTINE init_dim_obs_l_pdaf(domain_p, step, dim_obs_f, dim_obs_l)
call C_F_POINTER(xcoord, xcoord_fortran, [enkf_subvecsize])
call C_F_POINTER(ycoord, ycoord_fortran, [enkf_subvecsize])
call C_F_POINTER(zcoord, zcoord_fortran, [enkf_subvecsize])
ENDIF
END IF

! Index for local analysis domain `domain_p` in coordinate array
! that only spans `enkf_subvecsize`.
Expand Down Expand Up @@ -208,8 +208,8 @@ SUBROUTINE init_dim_obs_l_pdaf(domain_p, step, dim_obs_f, dim_obs_l)
obsind(i) = 1
end if
end do
endif
endif
end if
end if
#endif
#endif

Expand Down Expand Up @@ -242,8 +242,8 @@ SUBROUTINE init_dim_obs_l_pdaf(domain_p, step, dim_obs_f, dim_obs_l)
end if
end if
end do
enddo
enddo
end do
end do

do m = 1, dim_nx
do k = 1, dim_ny
Expand All @@ -264,8 +264,8 @@ SUBROUTINE init_dim_obs_l_pdaf(domain_p, step, dim_obs_f, dim_obs_l)
end if
end if
end do
enddo
enddo
end do
end do
end if
else
if(model == tag_model_clm) THEN
Expand Down
Loading
Loading