Skip to content

Commit

Permalink
revert/adjust previous commit
Browse files Browse the repository at this point in the history
back to original "K" (21) / "k" (39) spelling  but still remove wrong BARRIER (within
Master-Thread section).
  • Loading branch information
jm-c committed Nov 19, 2024
1 parent c660991 commit 1f1f680
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions pkg/profiles/cost_profiles.F
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
#ifdef ALLOW_PROFILES

C ========= Local variables =======================
integer k,num_file,num_var,prof_num
integer K,num_file,num_var,prof_num
integer bi,bj,iG,jG,fid
_RL prof_traj1D(NLEVELMAX), prof_traj1D_mean(NLEVELMAX)
_RL prof_data1D(NLEVELMAX), prof_weights1D(NLEVELMAX)
Expand Down Expand Up @@ -149,9 +149,9 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
endif

C find the vertical indices
do k=1,NLEVELMAX
do K=1,NLEVELMAX
prof_lev_comb(k,num_file,bi,bj) = -999
if(k.LE.ProfDepthNo(num_file,bi,bj)) then
if(K.LE.ProfDepthNo(num_file,bi,bj)) then
do k2 = 1, NLEVELCOMB
if(prof_depth(num_file, k,bi,bj).EQ.
& prof_depth_comb(k2,bi,bj).AND.
Expand All @@ -168,7 +168,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
do prof_num=1,NOBSGLOB
if (prof_num.LE.ProfNo(num_file,bi,bj)) then

do k=1,NLEVELMAX
do K=1,NLEVELMAX
prof_traj1D(k)=0.
C prof_traj1D_mean(k)=0.
C prof_mask1D_cur(k,bi,bj)=0.
Expand Down Expand Up @@ -201,9 +201,9 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
& ProfDepthNo(num_file,bi,bj),
& prof_weights1D,bi,bj,myThid)

do k=1,ProfDepthNo(num_file,bi,bj)
if (prof_weights1D(k).GT.0. _d 0
& .AND. prof_mask1D_cur(k,bi,bj).NE. 0. _d 0
do K=1,ProfDepthNo(num_file,bi,bj)
if (prof_weights1D(K).GT.0. _d 0
& .AND. prof_mask1D_cur(K,bi,bj).NE. 0. _d 0
& ) then
prof_traj1D_all_mean(itmp,
& prof_lev_comb(k,num_file,bi,bj),num_var)
Expand All @@ -229,7 +229,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
& prof_lev_comb(k,num_file,bi,bj), num_var)
& + 1. _d 0
endif
enddo !do k=1,ProfDepthNo
enddo !do K=1,ProfDepthNo
endif ! if(ix9 .GE. 0. _d 0 .AND. iy9 .GE. 0. _d 0) then

endif !if (prof_num.LE.ProfNo(num_file,bi,bj)) then
Expand Down Expand Up @@ -436,7 +436,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )

do num_var=1,NVARMAX

do k=1,NLEVELMAX
do K=1,NLEVELMAX
prof_traj1D(k)=0.
prof_traj1D_mean(k)=0.
prof_mask1D_cur(k,bi,bj)=0.
Expand All @@ -453,7 +453,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
#ifdef ALLOW_PROFILES_SAMPLESPLIT_COST
itmp = prof_ind_avgbin(num_file,prof_num,bi,bj)
if(itmp.GE. 0) then
do k=1,ProfDepthNo(num_file,bi,bj)
do K=1,ProfDepthNo(num_file,bi,bj)

ktmp = prof_lev_comb(k,num_file,bi,bj)
prof_traj1D_mean(k) =
Expand Down Expand Up @@ -481,28 +481,28 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
& ProfDepthNo(num_file,bi,bj),
& prof_weights1D,bi,bj,myThid)

do k=1,ProfDepthNo(num_file,bi,bj)
if (prof_weights1D(k).GT.0.
do K=1,ProfDepthNo(num_file,bi,bj)
if (prof_weights1D(K).GT.0.
#ifdef ALLOW_PROFILES_SAMPLESPLIT_COST
& .AND. prof_data1D_mean(k).NE. 0. _d 0
& .AND. prof_data1D_mean(K).NE. 0. _d 0
#endif
& ) then
objf_profiles(num_file,num_var,bi,bj)=
& objf_profiles(num_file,num_var,bi,bj)
& +prof_weights1D(k)*prof_mask1D_cur(k,bi,bj)
& *(prof_traj1D(k)-prof_data1D(k)-prof_traj1D_mean(k)
& +prof_weights1D(K)*prof_mask1D_cur(K,bi,bj)
& *(prof_traj1D(K)-prof_data1D(K)-prof_traj1D_mean(K)
#ifdef ALLOW_PROFILES_SAMPLESPLIT_COST
& + prof_data1D_mean(k)
& + prof_data1D_mean(K)
#endif
& )
& *(prof_traj1D(k)-prof_data1D(k)-prof_traj1D_mean(k)
& *(prof_traj1D(K)-prof_data1D(K)-prof_traj1D_mean(K)
#ifdef ALLOW_PROFILES_SAMPLESPLIT_COST
& + prof_data1D_mean(k)
& + prof_data1D_mean(K)
#endif
& )
num_profiles(num_file,num_var,bi,bj)=
& num_profiles(num_file,num_var,bi,bj)
& +prof_mask1D_cur(k,bi,bj)
& +prof_mask1D_cur(K,bi,bj)
endif
enddo
endif
Expand Down Expand Up @@ -532,7 +532,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
#ifdef ALLOW_PROFILES_SAMPLESPLIT_COST
do num_var=1,NVARMAX
DO iavgbin = 1, NAVGBINMAX
do k=1,NLEVELCOMB
do K=1,NLEVELCOMB
prof_traj1D_mean(1) =
& prof_traj1D_all_mean(iavgbin,k,num_var)
prof_data1D_mean(1) =
Expand Down Expand Up @@ -575,7 +575,7 @@ SUBROUTINE cost_profiles( myIter, myTime, myThid )
endif ! if(avgbinglbsum(iavgbin).EQ.1) then

endif ! if (prof_weights1D_mean(1).GT.0.
enddo !do k=1,NLEVELCOMB
enddo !do K=1,NLEVELCOMB
enddo !DO iavgbin = 1
enddo !do num_var

Expand Down

0 comments on commit 1f1f680

Please sign in to comment.