Changeset 2587 for branches/TAM_V3_0/NEMOTAM/OPATAM_SRC/step_tam.F90
- Timestamp:
- 2011-02-15T12:58:59+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TAM_V3_0/NEMOTAM/OPATAM_SRC/step_tam.F90
r1885 r2587 43 43 & tb, sb, tn, sn, ta, & 44 44 & un, vn, sshn, sshb, & 45 & sa, ub, vb, 45 & sa, ub, vb, rn2, & 46 46 & ln_dynhpg_imp 47 47 USE zdfkpp , ONLY: & … … 76 76 & ln_traqsr 77 77 ! solar radiation penetration flag 78 USE asminc 79 USE asmbkg 78 80 USE oce_tam , ONLY: & ! Tangent linear and adjoint variables 79 81 & oce_tam_init, & … … 134 136 USE wzvmod_tam ! vertical velocity (adjoint of wzv routine) 135 137 136 USE zdfkpp_tam ! KPP vertical mixing 137 138 !! USE zdfkpp_tam ! KPP vertical mixing 139 USE zdf_oce, ONLY : lk_zdfcst, avt, avt0, avmu, avmv, avm0, ln_zdfevd ! KPP vertical mixing 140 USE zdfddm, ONLY : & ! double diffusion mixing (zdf_ddm routine) 141 & lk_zdfddm, & 142 & zdf_ddm 143 USE zdfevd, only:zdf_evd ! double diffusion mixing (zdf_ddm routine) 144 USE zdfbfr, only:zdf_bfr ! double diffusion mixing (zdf_ddm routine) 145 USE zdfmxl, only:zdf_mxl ! double diffusion mixing (zdf_ddm routine) 146 USE eosbn2, ONLY: bn2 138 147 USE zpshde_tam ! partial step: hor. derivative (adjoint of zps_hde routine) 139 148 … … 186 195 PUBLIC stp_tan, & 187 196 & stp_adj, & ! called by simvar.F90 197 #if defined key_tst_tlm 188 198 & stp_tlm_tst, & 199 #endif 189 200 & stp_adj_tst 190 201 … … 257 268 ! Output the initial state and forcings ... not needed in tangent 258 269 259 ! saving direct variables ua,va, ta, sa before entering in tracer260 zta_tmp (:,:,:) = ta (:,:,:)261 zsa_tmp (:,:,:) = sa (:,:,:)262 270 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 263 271 ! Ocean physics update … … 315 323 316 324 #endif 317 318 ta (:,:,:) = zta_tmp (:,:,:)319 sa (:,:,:) = zsa_tmp (:,:,:)320 325 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 321 326 ! Active tracers … … 1184 1189 1185 1190 END SUBROUTINE stp_adj_tst 1186 1191 #if defined key_tst_tlm 1187 1192 SUBROUTINE stp_tlm_tst( kumadt ) 1188 1193 !!----------------------------------------------------------------------- … … 1228 1233 & lk_c1d 1229 1234 USE par_tlm, ONLY: & 1235 & tlm_bch, & 1230 1236 & cur_loop, & 1231 1237 & h_ratio … … 1262 1268 & zgsp1, zgsp2, zgsp3, zgsp4, zgsp5, & 1263 1269 & zgsp6, zgsp7 1270 REAL(KIND=wp) :: & 1271 & zgsp1_U, zgsp1_V, zgsp1_T, zgsp1_S, zgsp1_SSH, & 1272 & zgsp4_U, zgsp4_V, zgsp4_T, zgsp4_S, zgsp4_SSH, & 1273 & zgsp5_U, zgsp5_V, zgsp5_T, zgsp5_S, zgsp5_SSH 1264 1274 REAL(KIND=wp), DIMENSION(:,:,:), ALLOCATABLE :: & 1265 1275 & ta_tmp , & … … 1288 1298 1289 1299 CHARACTER(LEN=14) :: cl_name 1290 CHARACTER (LEN=128) :: file_out, file_wop, file_wop2 1300 CHARACTER (LEN=128) :: file_out, file_wop, file_wop2, file_xdx 1291 1301 CHARACTER (LEN=90) :: FMT 1292 1302 … … 1388 1398 ! Output filename Xn=F(X0) 1389 1399 !-------------------------------------------------------------------- 1390 file_wop='trj_wop_step'1391 1400 CALL tlm_namrd 1392 1401 gamma = h_ratio 1402 file_wop='trj_wop_step' 1403 file_xdx='trj_xdx_step' 1393 1404 !-------------------------------------------------------------------- 1394 1405 ! Initialize the tangent input with random noise: dx … … 1450 1461 ENDIF 1451 1462 ENDIF 1452 CALL istate_p1463 IF ( tlm_bch /= 2 ) CALL istate_p 1453 1464 1454 1465 !-------------------------------------------------------------------- … … 1456 1467 !-------------------------------------------------------------------- 1457 1468 1458 PRINT*,'IN TST_STP h_ratio, cur_loop, gamma', h_ratio, ' ',cur_loop,' ', gamma1459 Call flush(numout)1460 1461 1469 ! check that all process are still there... If some process have an error, 1462 1470 ! they will never enter in step and other processes will wait until the end of the cpu time! … … 1464 1472 1465 1473 istp = nit000 1474 IF ( tlm_bch /= 2 ) THEN 1466 1475 IF( lk_c1d ) THEN ! 1D configuration (no AGRIF zoom) 1467 !1468 1476 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 1469 1477 CALL stp_c1d( istp ) 1470 1478 istp = istp + 1 1471 1479 END DO 1472 ELSE 1473 istp = nit000 - 1 1474 IF( ln_trjwri ) CALL tam_trj_wri( istp ) ! Output trajectory fields 1480 ENDIF 1475 1481 ENDIF 1476 1482 … … 1497 1503 ! Compute the direct model F(X0,t=n) = Xn 1498 1504 !-------------------------------------------------------------------- 1505 IF ( tlm_bch /= 2 ) THEN 1499 1506 DO istp = nit000, nitend, 1 1500 1507 CALL stp( istp ) 1501 1508 END DO 1502 IF ( cur_loop .EQ. 0) CALL trj_wri_spl(file_wop) 1503 1509 ENDIF 1510 IF ( tlm_bch == 0 ) CALL trj_wri_spl(file_wop) 1511 IF ( tlm_bch == 1 ) CALL trj_wri_spl(file_xdx) 1504 1512 !-------------------------------------------------------------------- 1505 1513 ! Compute the Tangent 1506 1514 !-------------------------------------------------------------------- 1507 IF ( cur_loop .NE. 0) THEN 1508 1509 !-------------------------------------------------------------------- 1510 ! Storing data 1511 !-------------------------------------------------------------------- 1512 zun_out (:,:,:) = un (:,:,:) 1513 zvn_out (:,:,:) = vn (:,:,:) 1514 ztn_out (:,:,:) = tn (:,:,:) 1515 zsn_out (:,:,:) = sn (:,:,:) 1516 zsshn_out (:,: ) = sshn (:,: ) 1515 IF ( tlm_bch == 2 ) THEN 1517 1516 1518 1517 !-------------------------------------------------------------------- … … 1520 1519 !-------------------------------------------------------------------- 1521 1520 qrp_tl = 0.0_wp 1522 1521 #if defined key_tradmp 1522 strdmp_tl = 0.0_wp 1523 ttrdmp_tl = 0.0_wp 1524 #endif 1523 1525 a_fwb_tl = 0.0_wp 1524 1526 … … 1535 1537 ! Initialization of the dynamics and tracer fields for the tangent 1536 1538 !----------------------------------------------------------------------- 1539 1537 1540 CALL istate_init_tan 1541 1538 1542 DO istp = nit000, nitend, 1 1539 1543 CALL stp_tan( istp ) 1544 !CALL stp_tan_cpd( istp ) 1540 1545 END DO 1541 1546 … … 1556 1561 !-------------------------------------------------------------------- 1557 1562 CALL trj_rd_spl(file_wop) 1558 1559 1563 zun_wop (:,:,:) = un (:,:,:) 1560 1564 zvn_wop (:,:,:) = vn (:,:,:) … … 1562 1566 zsn_wop (:,:,:) = sn (:,:,:) 1563 1567 zsshn_wop (:,: ) = sshn (:,: ) 1568 CALL trj_rd_spl(file_xdx) 1569 zun_out (:,:,:) = un (:,:,:) 1570 zvn_out (:,:,:) = vn (:,:,:) 1571 ztn_out (:,:,:) = tn (:,:,:) 1572 zsn_out (:,:,:) = sn (:,:,:) 1573 zsshn_out (:,: ) = sshn (:,: ) 1564 1574 !-------------------------------------------------------------------- 1565 1575 ! Compute the Linearization Error … … 1711 1721 zzsp_SSH = SQRT(zsp3_SSH) 1712 1722 zgsp5 = zzsp 1723 zgsp5_U=zzsp_U 1724 zgsp5_V=zzsp_V 1725 zgsp5_T=zzsp_T 1726 zgsp5_S=zzsp_S 1727 zgsp5_SSH=zzsp_SSH 1713 1728 CALL prntst_tlm( cl_name, kumadt, zzsp, h_ratio ) 1714 1729 … … 1729 1744 zzsp_SSH = SQRT(zsp2_SSH) 1730 1745 zgsp4 = zzsp 1746 zgsp4_U=zzsp_U 1747 zgsp4_V=zzsp_V 1748 zgsp4_T=zzsp_T 1749 zgsp4_S=zzsp_S 1750 zgsp4_SSH=zzsp_SSH 1731 1751 cl_name = 'step_tam:Ln2 ' 1732 1752 CALL prntst_tlm( cl_name, kumadt, zzsp, h_ratio ) … … 1761 1781 zgsp7 = zgsp3/gamma 1762 1782 zgsp1 = zzsp 1783 zgsp1_U=zzsp_U 1784 zgsp1_V=zzsp_V 1785 zgsp1_T=zzsp_T 1786 zgsp1_S=zzsp_S 1787 zgsp1_SSH=zzsp_SSH 1763 1788 zgsp2 = zgsp1 / zgsp4 1764 1789 zgsp6 = (zgsp2 - 1.0_wp)/gamma 1765 1790 1766 1791 FMT = "(A8,2X,I4.4,2X,E6.1,2X,E20.13,2X,E20.13,2X,E20.13,2X,E20.13,2X,E20.13,2X,E20.13,2X,E20.13)" 1767 WRITE(numtan,FMT) 'step ', cur_loop, h_ratio, zgsp1, zgsp2, zgsp3, zgsp4, zgsp5, zgsp6, zgsp7 1768 1792 1793 WRITE(numtan,FMT) 'step ', cur_loop, h_ratio, zgsp1, zgsp1_T ,zgsp4_T, zgsp5_T,zgsp1_S,zgsp4_S,zgsp5_S!, 1769 1794 !-------------------------------------------------------------------- 1770 1795 ! Unitary calculus … … 1921 1946 !!====================================================================== 1922 1947 #endif 1948 #endif 1923 1949 END MODULE step_tam
Note: See TracChangeset
for help on using the changeset viewer.