Changeset 11603 for NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_interp.F90
- Timestamp:
- 2019-09-26T17:27:43+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_oce_interp.F90
r11590 r11603 45 45 PUBLIC interpe3t, interpumsk, interpvmsk 46 46 47 INTEGER :: bdy_tinterp = 0 48 47 49 # include "vectopt_loop_substitute.h90" 48 50 !!---------------------------------------------------------------------- … … 501 503 CALL Agrif_Bc_variable( vb2b_interp_id, calledweight=1._wp, procname=interpvb2b ) 502 504 ! 505 bdy_tinterp = 1 503 506 CALL Agrif_Bc_variable( unb_id , calledweight=1._wp, procname=interpunb ) ! After 504 CALL Agrif_Bc_variable( vnb_id , calledweight=1._wp, procname=interpvnb ) 507 CALL Agrif_Bc_variable( vnb_id , calledweight=1._wp, procname=interpvnb ) 505 508 ! 509 bdy_tinterp = 2 506 510 CALL Agrif_Bc_variable( unb_id , calledweight=0._wp, procname=interpunb ) ! Before 507 CALL Agrif_Bc_variable( vnb_id , calledweight=0._wp, procname=interpvnb ) 511 CALL Agrif_Bc_variable( vnb_id , calledweight=0._wp, procname=interpvnb ) 508 512 ELSE ! Linear interpolation 509 513 ! … … 703 707 ENDDO 704 708 IF (N_in > 0) THEN 705 DO jn=1,jpts 706 call reconstructandremap(tabin(1:N_in,jn),h_in(1:N_in),ptab_child(ji,jj,1:N_out,jn),h_out(1:N_out),N_in,N_out) 707 ENDDO 709 CALL reconstructandremap(tabin(1:N_in,1:jpts),h_in(1:N_in),ptab_child(ji,jj,1:N_out,1:jpts),h_out(1:N_out),N_in,N_out,jpts) 708 710 ENDIF 709 711 ENDDO … … 800 802 ENDIF 801 803 802 IF (N_in * N_out > 0) THEN 803 h_diff = sum(h_out(1:N_out))-sum(h_in(1:N_in)) 804 ! Should be able to remove the next IF/ELSEIF statement once scale factors are dealt with properly 805 if (h_diff < -1.e4) then 806 print *,'CHECK YOUR BATHY ...', h_diff, sum(h_out(1:N_out)), sum(h_in(1:N_in)) 807 ! stop 808 endif 809 ENDIF 810 call reconstructandremap(tabin(1:N_in),h_in(1:N_in),ua(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out) 804 CALL reconstructandremap(tabin(1:N_in),h_in(1:N_in),ua(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out,1) 811 805 ENDDO 812 806 ENDDO … … 881 875 CYCLE 882 876 ENDIF 883 call reconstructandremap(tabin(1:N_in),h_in(1:N_in),va(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out )877 call reconstructandremap(tabin(1:N_in),h_in(1:N_in),va(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out,1) 884 878 END DO 885 879 END DO … … 916 910 DO ji = i1, i2 917 911 DO jj = j1, j2 918 IF ( utint_stage(ji,jj) == 1 ) THEN 919 ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & 920 & - zt0**2._wp * ( zt0 - 1._wp) ) 921 ELSEIF( utint_stage(ji,jj) == 2 ) THEN 922 ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & 923 & - zt0 * ( zt0 - 1._wp)**2._wp ) 924 ELSEIF( utint_stage(ji,jj) == 0 ) THEN 925 ztcoeff = 1._wp 926 ELSE 927 ztcoeff = 0._wp 928 ENDIF 929 ! 930 ubdy(ji,jj) = ubdy(ji,jj) + ztcoeff * ptab(ji,jj) 931 ! 932 IF (( utint_stage(ji,jj) == 2 ).OR.( utint_stage(ji,jj) == 0 )) THEN 933 ubdy(ji,jj) = ubdy(ji,jj) / (zrhoy*e2u(ji,jj)) * umask(ji,jj,1) 934 utint_stage(ji,jj) = 3 935 ELSE 912 IF ( utint_stage(ji,jj) < (bdy_tinterp + 1) ) THEN 913 IF ( utint_stage(ji,jj) == 1 ) THEN 914 ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & 915 & - zt0**2._wp * ( zt0 - 1._wp) ) 916 ELSEIF( utint_stage(ji,jj) == 2 ) THEN 917 ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & 918 & - zt0 * ( zt0 - 1._wp)**2._wp ) 919 ELSEIF( utint_stage(ji,jj) == 0 ) THEN 920 ztcoeff = 1._wp 921 ELSE 922 ztcoeff = 0._wp 923 ENDIF 924 ! 925 ubdy(ji,jj) = ubdy(ji,jj) + ztcoeff * ptab(ji,jj) 926 ! 927 IF (( utint_stage(ji,jj) == 2 ).OR.( utint_stage(ji,jj) == 0 )) THEN 928 ubdy(ji,jj) = ubdy(ji,jj) / (zrhoy*e2u(ji,jj)) * umask(ji,jj,1) 929 ENDIF 930 ! 936 931 utint_stage(ji,jj) = utint_stage(ji,jj) + 1 937 932 ENDIF … … 966 961 DO ji = i1, i2 967 962 DO jj = j1, j2 968 IF ( vtint_stage(ji,jj) == 1 ) THEN 969 ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & 970 & - zt0**2._wp * ( zt0 - 1._wp) ) 971 ELSEIF( vtint_stage(ji,jj) == 2 ) THEN 972 ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & 973 & - zt0 * ( zt0 - 1._wp)**2._wp ) 974 ELSEIF( vtint_stage(ji,jj) == 0 ) THEN 975 ztcoeff = 1._wp 976 ELSE 977 ztcoeff = 0._wp 978 ENDIF 979 ! 980 vbdy(ji,jj) = vbdy(ji,jj) + ztcoeff * ptab(ji,jj) 981 ! 982 IF (( vtint_stage(ji,jj) == 2 ).OR.( vtint_stage(ji,jj) == 0 )) THEN 983 vbdy(ji,jj) = vbdy(ji,jj) / (zrhox*e1v(ji,jj)) * vmask(ji,jj,1) 984 vtint_stage(ji,jj) = 3 985 ELSE 963 IF ( vtint_stage(ji,jj) < (bdy_tinterp + 1) ) THEN 964 IF ( vtint_stage(ji,jj) == 1 ) THEN 965 ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & 966 & - zt0**2._wp * ( zt0 - 1._wp) ) 967 ELSEIF( vtint_stage(ji,jj) == 2 ) THEN 968 ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & 969 & - zt0 * ( zt0 - 1._wp)**2._wp ) 970 ELSEIF( vtint_stage(ji,jj) == 0 ) THEN 971 ztcoeff = 1._wp 972 ELSE 973 ztcoeff = 0._wp 974 ENDIF 975 ! 976 vbdy(ji,jj) = vbdy(ji,jj) + ztcoeff * ptab(ji,jj) 977 ! 978 IF (( vtint_stage(ji,jj) == 2 ).OR.( vtint_stage(ji,jj) == 0 )) THEN 979 vbdy(ji,jj) = vbdy(ji,jj) / (zrhox*e1v(ji,jj)) * vmask(ji,jj,1) 980 ENDIF 981 ! 986 982 vtint_stage(ji,jj) = vtint_stage(ji,jj) + 1 987 983 ENDIF … … 1249 1245 ENDDO 1250 1246 IF (N_in > 0) THEN 1251 CALL reconstructandremap(tabin(1:N_in),h_in,avm_k(ji,jj,1:N_out),h_out,N_in,N_out )1247 CALL reconstructandremap(tabin(1:N_in),h_in,avm_k(ji,jj,1:N_out),h_out,N_in,N_out,1) 1252 1248 ENDIF 1253 1249 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.