Changeset 6930
 Timestamp:
 20160915T15:19:19+02:00 (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90
r6445 r6930 945 945 !! 946 946 ! 947 zrhoy = Agrif_rhoy() 947 948 IF (before) THEN 948 949 DO jk=1,jpk 949 950 DO jj=j1,j2 950 951 DO ji=i1,i2 951 ptab(ji,jj,jk,1) = e2u(ji,jj) * un(ji,jj,jk) 952 ptab(ji,jj,jk,1) = ptab(ji,jj,jk,1) * e3u_n(ji,jj,jk) 953 ptab(ji,jj,jk,2) = e3u_n(ji,jj,jk) 952 ptab(ji,jj,jk,1) = e2u(ji,jj) * un(ji,jj,jk) * e3u_n(ji,jj,jk)/zrhoy 953 ptab(ji,jj,jk,2) = e2u(ji,jj) * e3u_n(ji,jj,jk)/zrhoy 954 954 END DO 955 955 END DO … … 961 961 962 962 ptab_child(:,:,:) = 0. 963 dojj=j1,j2964 doji=i1,i2965 iref = ji966 IF (western_side) iref = 2967 IF (eastern_side) iref = nlci2968 969 N_in = 0970 dojk=k1,k2971 if (interp_scales_u(ji,jj,jk) == 0) EXIT972 N_in = N_in + 1973 tabin(jk) = ptab(ji,jj,jk,1)/ptab(ji,jj,jk,2)974 h_in(N_in) = ptab(ji,jj,jk,2)975 enddo963 DO jj=j1,j2 964 DO ji=i1,i2 965 iref = ji 966 IF (western_side) iref = 2 967 IF (eastern_side) iref = nlci2 968 969 N_in = 0 970 DO jk=k1,k2 971 IF (ptab(ji,jj,jk,2) == 0) EXIT 972 N_in = N_in + 1 973 tabin(jk) = ptab(ji,jj,jk,1)/ptab(ji,jj,jk,2) 974 h_in(N_in) = ptab(ji,jj,jk,2)/e2u(ji,jj) 975 ENDDO 976 976 977 IF (N_in == 0) THEN978 ptab_child(ji,jj,:) = 0.979 CYCLE980 ENDIF977 IF (N_in == 0) THEN 978 ptab_child(ji,jj,:) = 0. 979 CYCLE 980 ENDIF 981 981 982 N_out = 0983 dojk=1,jpk984 if (umask(iref,jj,jk) == 0) EXIT985 N_out = N_out + 1986 h_out(N_out) = e3u_n(ji,jj,jk)987 enddo982 N_out = 0 983 DO jk=1,jpk 984 if (umask(iref,jj,jk) == 0) EXIT 985 N_out = N_out + 1 986 h_out(N_out) = e3u_n(ji,jj,jk) 987 ENDDO 988 988 989 IF (N_out == 0) THEN990 ptab_child(ji,jj,:) = 0.991 CYCLE992 ENDIF989 IF (N_out == 0) THEN 990 ptab_child(ji,jj,:) = 0. 991 CYCLE 992 ENDIF 993 993 994 h_diff = sum(h_out(1:N_out))sum(h_in(1:N_in)) 995 IF (h_diff > 0.) THEN 996 N_in = N_in + 1 997 h_in(N_in) = h_diff 998 tabin(N_in) = 0. 999 ELSE 1000 h_out(N_out) = h_out(N_out)  h_diff 1001 ENDIF 994 h_diff = sum(h_out(1:N_out))sum(h_in(1:N_in)) 995 IF (abs(h_diff) > 0.) THEN 996 CALL ctl_stop 997 ENDIF 998 call reconstructandremap(tabin(1:N_in),h_in(1:N_in),ptab_child(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out) 1002 999 1003 call reconstructandremap(tabin(1:N_in),h_in(1:N_in),ptab_child(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out) 1004 1005 ptab_child(ji,jj,N_out) = ptab_child(ji,jj,N_out) * h_out(N_out) / e3u_n(ji,jj,N_out) 1006 1000 ENDDO 1007 1001 ENDDO 1008 ENDDO1009 1002 1010 1003 ! in the following 1011 ! remove division of ua by fs e3u (already done) 1004 ! remove division of ua by fs e3u (already done) and also zrhoy and e2u 1012 1005 ! VERTICAL REFINEMENT END 1013 1006 1014 zrhoy = Agrif_Rhoy()1015 1007 DO jk = 1, jpkm1 1016 1008 DO jj=j1,j2 1017 ua(i1:i2,jj,jk) = (ptab_child(i1:i2,jj,jk)/(zrhoy*e2u(i1:i2,jj))) 1009 ua(i1:i2,jj,jk) = ptab_child(i1:i2,jj,jk) 1010 !/(zrhoy*e2u(i1:i2,jj))) 1011 write(numout,*) 'ua=',ua(i1:i2,jj,jk) 1018 1012 END DO 1019 1013 END DO
Note: See TracChangeset
for help on using the changeset viewer.