SUBROUTINE writeprofile(nlev,data,name2,iq,qsurf) IMPLICIT NONE ! arguments: INTEGER nlev,iq REAL data(nlev) REAL qsurf CHARACTER(len=30) :: name2 !local INTEGER il !write the data OPEN(iq,file='profile_out_'//trim(name2),form='formatted') write(iq,*) qsurf DO il=1,nlev write(iq,*) data(il) ENDDO CLOSE(iq) RETURN END