/[MITgcm]/MITgcm_contrib/jmc_script/cmpnum.f
ViewVC logotype

Annotation of /MITgcm_contrib/jmc_script/cmpnum.f

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Mar 17 19:59:54 2022 UTC (3 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
add simple script "comp_res" to compare MONITOR output from 2 standard output-files
(similar to what is done within testreport but made availabe outside testreport).

1 jmc 1.1 C $Header: $
2     C $Name: $
3     program cmpnum
4     implicit none
5     real*8 a,b,diff
6     integer linnum,tmp,best
7     open(17,file='cmpnum.log',status='unknown')
8     best=-22
9     99 read(*,*,end=70,err=60) linnum,a,b
10     diff=0.5*(abs(a)+abs(b))
11     c print *,a,b,diff,abs(a-b)/diff
12     c if (diff.gt.1.e-12) then
13     if (diff.gt.0.) then
14     diff=abs(a-b)/diff
15     if (diff.gt.0.) then
16     c print *,int(log10(diff)),diff
17     tmp=nint(log10(diff))
18     else
19     tmp=-16;
20     endif
21     best=max(best,tmp)
22     else
23     tmp =-22
24     endif
25     write(17,'(I4,1P2E22.14,A,I4)') linnum,a,b,' :',-tmp
26     goto 99
27     60 stop 'cmpnum: An error occured reading a,b'
28     70 continue
29     close(17)
30     print *,-best
31     end

  ViewVC Help
Powered by ViewVC 1.1.22