[1] | 1 | !WRF:MEDIATION_LAYER:INTERPOLATIONFUNCTION |
---|
| 2 | ! |
---|
| 3 | |
---|
| 4 | SUBROUTINE interp_fcn ( cfld, & ! CD field |
---|
| 5 | cids, cide, ckds, ckde, cjds, cjde, & |
---|
| 6 | cims, cime, ckms, ckme, cjms, cjme, & |
---|
| 7 | cits, cite, ckts, ckte, cjts, cjte, & |
---|
| 8 | nfld, & ! ND field |
---|
| 9 | nids, nide, nkds, nkde, njds, njde, & |
---|
| 10 | nims, nime, nkms, nkme, njms, njme, & |
---|
| 11 | nits, nite, nkts, nkte, njts, njte, & |
---|
| 12 | nri, nrj ) ! nest ratios |
---|
| 13 | IMPLICIT NONE |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | INTEGER, INTENT(IN) :: cids, cide, ckds, ckde, cjds, cjde, & |
---|
| 17 | cims, cime, ckms, ckme, cjms, cjme, & |
---|
| 18 | cits, cite, ckts, ckte, cjts, cjte, & |
---|
| 19 | nids, nide, nkds, nkde, njds, njde, & |
---|
| 20 | nims, nime, nkms, nkme, njms, njme, & |
---|
| 21 | nits, nite, nkts, nkte, njts, njte, & |
---|
| 22 | nri, nrj |
---|
| 23 | |
---|
| 24 | REAL, DIMENSION ( cims:cime, ckms:ckme, cjms:cjme ) :: cfld |
---|
| 25 | REAL, DIMENSION ( nims:nime, nkms:nkme, njms:njme ) :: nfld |
---|
| 26 | |
---|
| 27 | ! Local |
---|
| 28 | |
---|
| 29 | INTEGER ci, cj, ck, ni, nj, nk, ip, jp |
---|
| 30 | |
---|
| 31 | ! Iterate over the ND tile and comtute the values |
---|
| 32 | ! from the CD tile. |
---|
| 33 | |
---|
| 34 | DO nj = njts, njte |
---|
| 35 | cj = cjts + nj / nrj ! coord of CD point |
---|
| 36 | jp = cjts + mod ( nj , nrj ) ! coord of ND w/i CD point |
---|
| 37 | DO nk = nkts, nkte |
---|
| 38 | ck = nk |
---|
| 39 | DO ni = nits, nite |
---|
| 40 | ci = cits + ni / nri ! coord of CD point |
---|
| 41 | ip = cits + mod ( ni , nri ) ! coord of ND w/i CD point |
---|
| 42 | |
---|
| 43 | ! This is a trivial implementation of the interp_fcn; just copies |
---|
| 44 | ! the values from the CD into the ND |
---|
| 45 | |
---|
| 46 | nfld( ni, nk, nj ) = cfld( ci , ck , cj ) |
---|
| 47 | |
---|
| 48 | ENDDO |
---|
| 49 | ENDDO |
---|
| 50 | ENDDO |
---|
| 51 | |
---|
| 52 | RETURN |
---|
| 53 | |
---|
| 54 | END SUBROUTINE interp_fcn |
---|
| 55 | |
---|
| 56 | |
---|